示例#1
0
文件: run_tests.py 项目: kidaak/gaia
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
示例#2
0
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()
示例#3
0
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()
示例#4
0
文件: run_tests.py 项目: sildeag/gaia
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
示例#5
0
文件: run_tests.py 项目: DomT4/gaia
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()