Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
This is now only used for suite (not task) event handlers.

        def RunHandler( event, script, suite, taskID=None, msg=None, fg=False ):
    """This is now only used for suite (not task) event handlers."""

    tolog = 'Calling ' + event + ' handler'
    if fg:
        tolog += ' in the foreground'
    print tolog
    logger = logging.getLogger('main')
    logger.info( tolog )
    command = script + ' ' + event + ' ' + suite
    if taskID:
        command += ' ' + taskID
    command += " '" + msg + "'"
    if not fg:
        command += ' &'

    res = subprocess.call( command, shell=True )
    if fg and res != 0:
        raise Exception( 'ERROR: event handler failed' )
        


src/c/y/cylc-HEAD/lib/cylc/scheduler.py   cylc(Download)
from regpath import RegPath
from CylcError import TaskNotFoundError, TaskStateError
from RunEventHandler import RunHandler
from LogDiagnosis import LogSpec
from broadcast import broadcast
            for handler in handlers:
                try:
                    RunHandler( name, handler, self.suite, msg=msg, fg=fg )
                except Exception, x:
                    # Note: test suites depends on this message: