def main():
    parser = ArgumentParser(description="Run Graph Explorer")
    parser.add_argument("configfile", metavar="CONFIG_FILENAME", type=str)
    parser.add_argument("--debug", type=bool)
    args = parser.parse_args()

    config.init(args.configfile)
    
    c = ConfigValidator(obj=config)
    if not c.validate():
        print "Configuration errors (%s):" % args.configfile
        for (key, err) in c.errors.items():
            print key,
            for e in err:
                print "\n    %s" % e
        sys.exit(1)

    app_dir = os.path.dirname(__file__)
    if app_dir:
        os.chdir(app_dir)

    debug(args.debug)
    run('graph_explorer.app',
        reloader=True,
        host=config.listen_host,
        port=config.listen_port,
        server=PasteServer)
Beispiel #2
0
def test_config_valid():
    # TODO update this for new text files
    from graph_explorer import config
    from graph_explorer.validation import ConfigValidator

    c = ConfigValidator(obj=config)
    valid = c.validate()
    if not valid:
        from pprint import pprint
        pprint(c.errors)
Beispiel #3
0
def test_config_valid():
    from graph_explorer import config
    from graph_explorer.validation import ConfigValidator

    c = ConfigValidator(obj=config)
    valid = c.validate()
    if not valid:
        from pprint import pprint
        pprint(c.errors)
    assert valid
Beispiel #4
0
def valid_or_die():
    global config, file_name
    config = sys.modules[__name__]
    c = ConfigValidator(obj=config)
    if c.validate():
        return
    print "Configuration errors (%s):" % file_name
    for (key, err) in c.errors.items():
        print key,
        for e in err:
            print "\n    %s" % e
    sys.exit(1)
Beispiel #5
0
#!/opt/kup/virtupy/bin/python

import os
import sys
from bottle import run, debug, PasteServer
from graph_explorer import config
from graph_explorer.validation import ConfigValidator

c = ConfigValidator(obj=config)
if not c.validate():
    print "there's a problem with your configuration:"
    for (key, err) in c.errors.items():
        print key,
        for e in err:
            print "\n    ", e
    sys.exit(1)

app_dir = os.path.dirname(__file__)
if app_dir:
    os.chdir(app_dir)

debug(True)
run('graph_explorer.app',
    reloader=True,
    host=config.listen_host,
    port=config.listen_port,
    server=PasteServer)
#!/opt/kup/virtupy/bin/python

import os
import sys
from bottle import run, debug, PasteServer
from graph_explorer import config
from graph_explorer.validation import ConfigValidator

c = ConfigValidator(obj=config)
if not c.validate():
    print "there's a problem with your configuration:"
    for (key, err) in c.errors.items():
        print key,
        for e in err:
            print "\n    ", e
    sys.exit(1)


app_dir = os.path.dirname(__file__)
if app_dir:
    os.chdir(app_dir)

debug(True)
run('graph_explorer.app',
    reloader=True,
    host=config.listen_host,
    port=config.listen_port,
    server=PasteServer)