Esempio n. 1
0
def run_gui():
    """ Start Graphical User Interface """

    main_gui = Proximate_GUI()

    for modulename in [
        "community_gui",
        "messaging_gui",
        "notification_gui",
        "filesharing_gui",
        "messageboard_gui",
        "filetransfergui",
        "radar",
        "keymanagement_gui",
        "settings_gui",
    ]:
        module = __import__(modulename)
        try:
            module.init_ui(main_gui)
        except TypeError:
            die("GUI module %s init() called with invalid arguments\n" % (modulename))

    proximatestate.load_external_plugins(ui=main_gui)

    main_gui.run()
Esempio n. 2
0
def main(options, args):
    if options.debug:
        support.set_debug_mode(options.verbose)

    # Initialize seed for crypto and other plugins
    random.seed()

    # Init order for plugins: proximatestate, wlancontrol, community, ... (others)
    # State plugin must be the second plugin that is initialized
    proximatestate.init(options)

    # 'wlancontrol' and 'community' must be initialized first in this order
    for modulename in ['wlancontrol', 'community', 'udpfetcher',
                       'sendfile', 'tcpfetcher', 'fetcher',
                       'filesharing', 'settings',
                       'keymanagement', 'notify',
                       'messaging', 'scheduler', 'messageboard',
                       'userpresence', 'vibra']:
        module = __import__(modulename)
        try:
            module.init(options)
        except TypeError:
            raise
            die('module %s init() called with invalid arguments\n' %(modulename))

    proximatestate.load_external_plugins(options=options)

    plugins_ready()

    listener.init()

    rval = 1
    try:
        if options.usegui:
            from guihandler import run_gui
            run_gui()
        else:
            from cursesui import run_ui
            run_ui()
        rval = 0
    except Exception, err:
        import traceback
        print_exc()
        warning("proximate exception: %s\n" % err)