示例#1
0
def run():
    print "Starting OACWellcome Job Processor ... Started"
    initialise()
    error_handler.setup_error_logging(app, "OACWellcome Runner Error", stdout_logging_level=logging.INFO)
    while True:
        time.sleep(app.config.get('OACWELLCOME_JOBS_POLL_TIME', 2))
        try:
            process_jobs()
        except Exception:
            app.logger.error(traceback.format_exc())
        print ".",
        sys.stdout.flush()
from octopus.core import app, initialise
from octopus.lib import plugin, cli
import sys

command = sys.argv[1]
args = sys.argv[2:]

for name, path in app.config.get("CLI_SCRIPTS", {}).iteritems():
    ran = False
    if name == command:
        # get an instance of the script
        klazz = plugin.load_class(path)
        inst = klazz()

        # check that it can legitimately be run
        if not isinstance(inst, cli.Script):
            print command, "is not a legitimate octopus script - must extend from octopus.lib.cli.Script"
            exit()

        # ensure the app is initialised
        initialise()

        # run it
        ran = True
        klazz().run(args)

    if not ran:
        print command, "- command not found"
示例#3
0
 def setUp(self):
     initialise()
     time.sleep(1)
示例#4
0
 def setUp(self):
     initialise()
示例#5
0
 def setUp(self):
     initialise()
示例#6
0
 def sync_prep():
     initialise()