import datetime
import multiprocessing

from lobster.cmssw.plotting import Plotter

logger = multiprocessing.get_logger()

class DummyPlotter(object):
    def make_plots(*args, **kwargs):
        pass

class Actions(object):
    def __init__(self, config):
        if 'plotdir' in config:
            logger.info('plots in {0} will be updated automatically'.format(config['plotdir']))
            plotter = Plotter(config['filename'], config['plotdir'])
        else:
            plotter = DummyPlotter()

        def plotf(q):
            while q.get() not in ('stop', None):
                plotter.make_plots()

        self.plotq = multiprocessing.Queue()
        self.plotp = multiprocessing.Process(target=plotf, args=(self.plotq,))
        self.plotp.start()

        self.__last = datetime.datetime.now()

    def __del__(self):
        self.plotq.put('stop')

    def take(self):
        now = datetime.datetime.now()
        if (now - self.__last).seconds > 15 * 60:
            self.plotq.put('plot')
            self.__last = now

@@ -378,16 +378,170 @@
 dir'%5D))%0A
+            if 'foremen logs' in config:%0A                logger.info('foremen logs will be included from: %7B0%7D'.format(', '.join(config%5B'foremen logs'%5D)))%0A
         
@@ -759,16 +759,50 @@
 e_plots(
+foremen=config.get('foremen logs')
 )%0A%0A     

Allow users to add foremen plots for daemonized plotting.