Exemplo n.º 1
0
def main():
    config = get_config()
    tplugin = TermsPlugin(config)
    install(tplugin)
    host = 'http_host' in config and config['http_host'] or 'localhost'
    port = 'http_port' in config and config['http_port'] or 8080
    debug = 'debug' in config and config.getboolean('debug') or False
    run(host=host, port=port, debug=debug)
Exemplo n.º 2
0
def main():
    config = get_config()
    tplugin = TermsPlugin(config)
    install(tplugin)
    host = 'http_host' in config and config['http_host'] or 'localhost'
    port = 'http_port' in config and config['http_port'] or 8080
    debug = 'debug' in config and config.getboolean('debug') or False
    run(host=host, port=port, debug=debug)
Exemplo n.º 3
0
def init_terms():
    config = get_config()
    address = '%s/%s' % (config['dbms'], config['dbname'])
    engine = create_engine(address)
    Base.metadata.create_all(engine)
    Session = sessionmaker(bind=engine)
    session = Session()
    Network.initialize(session)
    session.commit()
    session.close()
    sys.exit(0)
Exemplo n.º 4
0
def main():
    config = get_config(cmd_line=False)
    if len(sys.argv) == 2:
        if 'start' == sys.argv[1]:
            start(config)
        elif 'stop' == sys.argv[1]:
            stop(config)
        elif 'restart' == sys.argv[1]:
            stop(config)
            start(config)
        else:
            print("Unknown command")
            sys.exit(2)
        sys.exit(0)
    else:
        print("usage: %s start|stop|restart" % sys.argv[0])
        sys.exit(2)
Exemplo n.º 5
0
def repl():
    config = get_config()
    tr = TermsRepl(config)
    profile.run(tr.run())