def run(args=None, intro=True): # display the 'grid-control' logo and version if intro and not os.environ.get('GC_DISABLE_INTRO'): sys.stdout.write(SafeFile(utils.pathShare('logo.txt'), 'r').read()) sys.stdout.write('Revision: %s\n' % utils.getVersion()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): utils.deprecated( 'This python version (%d.%d) is not supported anymore!' % pyver) Activity.root = Activity('Running grid-control', name='root') # top level activity instance # main try... except block to catch exceptions and show error message try: config = gc_create_config(args or sys.argv[1:], useDefaultFiles=True) workflow = gc_create_workflow(config) try: sys.exit(workflow.run()) finally: sys.stdout.write('\n') except SystemExit: # avoid getting caught for Python < 2.5 raise except Exception: # coverage overrides sys.excepthook gc_excepthook(*sys.exc_info()) sys.exit(os.EX_SOFTWARE)
def gc_run(args=None, intro=True): # display the 'grid-control' logo and version if intro and not os.environ.get('GC_DISABLE_INTRO'): sys.stdout.write(SafeFile(get_path_share('logo.txt'), 'r').read_close()) sys.stdout.write('Revision: %s\n' % get_version()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): deprecated('This python version (%d.%d) is not supported anymore!' % pyver) atexit.register(lambda: sys.stdout.write('\n')) # main try... except block to catch exceptions and show error message try: return _gc_run(args) except SystemExit: # avoid getting caught for Python < 2.5 abort(True) raise except Exception: # coverage overrides sys.excepthook abort(True) gc_excepthook(*sys.exc_info()) sys.exit(os.EX_SOFTWARE)
def run(): # set up signal handler for interrupts and debug session requests signal.signal(signal.SIGINT, handle_abort_interrupt) signal.signal(signal.SIGURG, handle_debug_interrupt) # display the 'grid-control' logo and version sys.stdout.write(open(utils.pathShare('logo.txt'), 'r').read()) sys.stdout.write('Revision: %s\n' % utils.getVersion()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): utils.deprecated('This python version (%d.%d) is not supported anymore!' % pyver) # main try... except block to catch exceptions and show error message try: config = gc_create_config(sys.argv[1:]) workflow = gc_create_workflow(config) sys.exit(workflow.run()) except SystemExit: pass except Exception: # coverage overrides sys.excepthook gc_excepthook(*sys.exc_info())
def gc_run(args=None, intro=True): # display the 'grid-control' logo and version if intro and not os.environ.get('GC_DISABLE_INTRO'): sys.stdout.write( SafeFile(get_path_share('logo.txt'), 'r').read_close()) sys.stdout.write('Revision: %s\n' % get_version()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): deprecated('This python version (%d.%d) is not supported anymore!' % pyver) atexit.register(lambda: sys.stdout.write('\n')) # main try... except block to catch exceptions and show error message try: return _gc_run(args) except SystemExit: # avoid getting caught for Python < 2.5 abort(True) raise except Exception: # coverage overrides sys.excepthook abort(True) gc_excepthook(*sys.exc_info()) sys.exit(os.EX_SOFTWARE)
def run(): # set up signal handler for interrupts and debug session requests signal.signal(signal.SIGINT, handle_abort_interrupt) signal.signal(signal.SIGURG, handle_debug_interrupt) # display the 'grid-control' logo and version sys.stdout.write(open(utils.pathShare('logo.txt'), 'r').read()) sys.stdout.write('Revision: %s\n' % utils.getVersion()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): utils.deprecated( 'This python version (%d.%d) is not supported anymore!' % pyver) # main try... except block to catch exceptions and show error message try: config = gc_create_config(sys.argv[1:]) workflow = gc_create_workflow(config) sys.exit(workflow.run()) except SystemExit: pass except Exception: # coverage overrides sys.excepthook gc_excepthook(*sys.exc_info())
def run(args = None, intro = True): # display the 'grid-control' logo and version if intro and not os.environ.get('GC_DISABLE_INTRO'): sys.stdout.write(SafeFile(utils.pathShare('logo.txt'), 'r').read()) sys.stdout.write('Revision: %s\n' % utils.getVersion()) pyver = (sys.version_info[0], sys.version_info[1]) if pyver < (2, 3): utils.deprecated('This python version (%d.%d) is not supported anymore!' % pyver) Activity.root = Activity('Running grid-control', name = 'root') # top level activity instance # main try... except block to catch exceptions and show error message try: config = gc_create_config(args or sys.argv[1:], useDefaultFiles = True) workflow = gc_create_workflow(config) try: sys.exit(workflow.run()) finally: sys.stdout.write('\n') except SystemExit: # avoid getting caught for Python < 2.5 raise except Exception: # coverage overrides sys.excepthook gc_excepthook(*sys.exc_info()) sys.exit(os.EX_SOFTWARE)