示例#1
0
    UI.banner()

    if len(sys.argv) < 3:
        UI.error(
            "Missing configuration file path or username\n\nUsage: %s config username (optional -nohttpd)"
            % sys.argv[0], True)

    config = CONFIG(sys.argv[1])
    if config.reload_config():
        config = CONFIG(sys.argv[1])

    profile = config.get("http-profile")
    if not profile == "":
        Utils.file_exists(profile, True)
        profile = CONFIG(profile)
        config.set("profile", profile)

    uid = Utils.guid()
    config.set("uid", uid)
    config.set("username", "(CLI)%s" % sys.argv[2])
    db = RedisQuery(config)
    sql = MySQLQuery(config)
    sql.install_db().init_uid()

    config.set("redis", db)
    config.set("mysql", sql)

    db.update_config(config).init_sql()

    UI.warn("Current Active session UUID is %s" % config.get("uid"))
示例#2
0
if __name__ == '__main__':

    if len(sys.argv) < 3:
        UI.error(
            '''Missing configuration file path or username\n\n Usage: %s config username (optional -nohttpd, -nogui)'''
            % sys.argv[0], True)

    config = CONFIG(sys.argv[1])
    if config.reload_config():
        config = CONFIG(sys.argv[1])

    profile = config.get('http-profile')
    if not profile == '':
        Utils.file_exists(profile, True)
        profile = CONFIG(profile)
        config.set('profile', profile)

    uid = Utils.guid()
    config.set('uid', uid)
    config.set('username', '%s' % sys.argv[2])
    db = RedisQuery(config)

    config.set('redis', db)

    UI.warn('Current Active CLI session UUID is %s' % config.get('uid'))

    cli = Cli(config)

    # Launch the GUI
    if not '-nogui' in sys.argv:
        webui_thread = init_gui_thread(config, cli)
示例#3
0
import sys
from core.config import CONFIG
from core.redisquery import RedisQuery
from core.httpd import init_httpd_thread
from core.cli import Cli
from core.ui import UI

if __name__ == "__main__":
    UI.banner()
    
    if len(sys.argv) < 2:
        UI.error("Missing configuration file path\n\nUsage: %s config (optional -nohttpd)" % sys.argv[0], True)
        
    config = CONFIG(sys.argv[1])
    db = RedisQuery(config)
    config.set("redis", db)
    
    
    # Launch the HTTPD daemon
    if not "-nohttpd" in sys.argv:
        httpd_thread = init_httpd_thread(config)
    
    cli = Cli(config)
    
    while True:
        try:
            cmd = cli.prompt()
            cli.parse_cmd(cmd)
            
        except KeyboardInterrupt as e:
            UI.error("*** You really want to exit the application? *** (yes/no)")
示例#4
0
from core.redisquery import RedisQuery
from core.httpd import init_httpd_thread
from core.cli import Cli
from core.ui import UI

if __name__ == "__main__":
    UI.banner()

    if len(sys.argv) < 2:
        UI.error(
            "Missing configuration file path\n\nUsage: %s config (optional -nohttpd)"
            % sys.argv[0], True)

    config = CONFIG(sys.argv[1])
    db = RedisQuery(config)
    config.set("redis", db)

    # Launch the HTTPD daemon
    if not "-nohttpd" in sys.argv:
        httpd_thread = init_httpd_thread(config)

    cli = Cli(config)

    while True:
        try:
            cmd = cli.prompt()
            cli.parse_cmd(cmd)

        except KeyboardInterrupt as e:
            UI.error(
                "*** You really want to exit the application? *** (yes/no)")
示例#5
0
if __name__ == '__main__':

    if len(sys.argv) < 3:
        UI.error(
            '''Missing configuration file path or username\n\n Usage: %s config username (optional -nohttpd, -gui)'''
            % sys.argv[0], True)

    config = CONFIG(sys.argv[1])
    if config.reload_config():
        config = CONFIG(sys.argv[1])

    profile = config.get('http-profile')
    if not profile == '':
        Utils.file_exists(profile, True)
        profile = CONFIG(profile)
        config.set('profile', profile)

    uid = Utils.guid()
    config.set('uid', uid)
    config.set('username', '(CLI)%s' % sys.argv[2])
    db = RedisQuery(config)
    sql = MySQLQuery(config)
    sql.install_db().init_uid()

    config.set('redis', db)
    config.set('mysql', sql)

    db.update_config(config).init_sql()
    UI.warn('Current Active CLI session UUID is %s' % config.get('uid'))

    # Launch the HTTPD daemon