def runTests(project_file): # open the yaml file describing the analysis to perform try: project_file = os.path.abspath(project_file) except: print "ERROR: You need to specify a yaml project file..." print "Exiting..." sys.exit(1) logging.getLogger("gaia2.classification").setLevel(debugLevel) if debugLevel == logging.DEBUG: cvar.verbose = True else: cvar.verbose = False # move to the project file directory so all paths can be relative olddir = os.getcwd() try: os.chdir(os.path.split(project_file)[0]) except OSError: pass test = ClassificationTaskManager(project_file) test.run() try: os.chdir(olddir) except OSError: pass
def runTests(): parser = OptionParser(usage = '%prog [options] project_file') options, args = parser.parse_args() try: project_file = args[0] except: parser.print_help() sys.exit(1) # open the yaml file describing the analysis to perform try: project_file = os.path.abspath(sys.argv[1]) except: print 'ERROR: You need to specify a yaml project file...' print 'Exiting...' sys.exit(1) logging.getLogger('gaia2.classification').setLevel(debugLevel) if debugLevel == logging.DEBUG: cvar.verbose = True else: cvar.verbose = False # move to the project file directory so all paths can be relative try: os.chdir(os.path.split(project_file)[0]) except OSError: pass test = ClassificationTaskManager(project_file) test.run()
def runTests(): parser = OptionParser(usage='%prog [options] project_file') options, args = parser.parse_args() try: project_file = args[0] except: parser.print_help() sys.exit(1) # open the yaml file describing the analysis to perform try: project_file = os.path.abspath(sys.argv[1]) except: print 'ERROR: You need to specify a yaml project file...' print 'Exiting...' sys.exit(1) logging.getLogger('gaia2.classification').setLevel(debugLevel) if debugLevel == logging.DEBUG: cvar.verbose = True else: cvar.verbose = False # move to the project file directory so all paths can be relative try: os.chdir(os.path.split(project_file)[0]) except OSError: pass test = ClassificationTaskManager(project_file) test.run()
def runTests(project_file): # open the yaml file describing the analysis to perform try: project_file = os.path.abspath(project_file) except: print('ERROR: You need to specify a yaml project file...') print('Exiting...') sys.exit(1) logging.getLogger('gaia2.classification').setLevel(debugLevel) if debugLevel == logging.DEBUG: cvar.verbose = True else: cvar.verbose = False # move to the project file directory so all paths can be relative olddir = os.getcwd() try: os.chdir(os.path.split(project_file)[0]) except OSError: pass test = ClassificationTaskManager(project_file) test.run() try: os.chdir(olddir) except OSError: pass
import os, os.path import sys import logging debugLevel = logging.INFO if __name__ == '__main__': # open the yaml file describing the analysis to perform try: yamlfile = os.path.abspath(sys.argv[1]) except: print 'ERROR: You need to specify a yaml project file...' print 'Exiting...' sys.exit(1) logging.getLogger('gaia2.classification').setLevel(debugLevel) if debugLevel == logging.DEBUG: cvar.verbose = True else: cvar.verbose = False # move to the project file directory so all paths can be relative try: os.chdir(os.path.split(yamlfile)[0]) except OSError: pass test = ClassificationTaskManager(yamlfile) test.run()