Beispiel #1
0
Datei: run.py Projekt: kaday/cylc
def main(name, start):
    # Parse the command line:
    server = start()

    # Print copyright and license information
    print_blurb()

    # Create run directory tree and get port.
    try:
        GLOBAL_CFG.create_cylc_run_tree(server.suite)
        server.configure_pyro()
    except Exception as exc:
        if flags.debug:
            raise
        else:
            sys.exit(exc)

    # Daemonize the suite
    if not server.options.no_detach and not flags.debug:
        daemonize(server)

    try:
        server.configure()
        server.run()
        # For profiling (see Python docs for how to display the stats).
        # import cProfile
        # cProfile.runctx('server.run()', globals(), locals(), 'stats')
    except SchedulerStop, x:
        # deliberate stop
        print str(x)
        server.shutdown()
Beispiel #2
0
def main(name, start):

    # Parse the command line:
    server = start()

    # Print copyright and license information
    print_blurb()

    # Before daemonizing attempt to create the suite output tree and get
    # the suite port file.

    try:
        if server.__class__.__name__ != 'restart':
            GLOBAL_CFG.create_cylc_run_tree(server.suite)
        server.configure_pyro()
    except Exception, x:
        if flags.debug:
            raise
        else:
            print >> sys.stderr, x
            sys.exit(1)