コード例 #1
0
ファイル: runner.py プロジェクト: CottageLabs/lantern-api
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()
コード例 #2
0
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
ファイル: testindex.py プロジェクト: tuub/magnificent-octopus
 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()