def oq(): modnames = ['openquake.commands.%s' % mod[:-3] for mod in os.listdir(commands.__path__[0]) if mod.endswith('.py') and not mod.startswith('_')] for modname in modnames: importlib.import_module(modname) parser = sap.compose(sap.Script.registry.values(), prog='oq', version=__version__) parser.callfunc()
def oq(): args = set(sys.argv[1:]) if 'engine' not in args and 'dbserver' not in args: # oq engine and oq dbserver define their own log levels logging.basicConfig(level=logging.INFO) modnames = [ 'openquake.commands.%s' % mod[:-3] for mod in os.listdir(commands.__path__[0]) if mod.endswith('.py') and not mod.startswith('_') ] for modname in modnames: importlib.import_module(modname) parser = sap.compose(sap.registry.values(), prog='oq', version=__version__) parser.callfunc()