Ejemplo n.º 1
0
def main():
    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    if config.get('no_use_indicator'):
        HAS_INDICATOR = False
    try:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hotot', 0, 0, 0)
    except:
        pass
    agent.init_notify()
    app = MainWindow()
    agent.app = app
    if HAS_INDICATOR:
        #TODO the icon is only work when installed to /usr/share/icons/hicolor/
        indicator = appindicator.Indicator('hotot',
                                           'hotot',
                                           appindicator.CATEGORY_COMMUNICATIONS)
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_attention_icon(config.get_ui_object('imgs/ic64_hotot.png'))
        indicator.set_menu(app.menu_tray)
        pass
    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 2
0
Archivo: hotot.py Proyecto: sarim/Hotot
def main():
    for opt in sys.argv[1:]:
        if opt in ('-h', '--help'):
            usage()
            sys.exit()
        elif opt in ('-d', '--dev'):
            config.ENABLE_INSPECTOR = True
        else:
            print "hotot: unrecognized option '%s'" % opt
            usage()
            sys.exit(1)

    try:
        import i18n
    except:
        from gettext import gettext as _

    try:
        import prctl
        prctl.set_name('hotot')
    except:
        pass

    GObject.threads_init()
    config.loads();

    agent.init_notify()
    app = Hotot()
    agent.app = app

    Gdk.threads_enter()
    Gtk.main()
    Gdk.threads_leave()
Ejemplo n.º 3
0
Archivo: hotot.py Proyecto: fma16/Hotot
def main():
    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    try:
        import ctypes
        libc = ctypes.CDLL('libc.so.6')
        libc.prctl(15, 'hotot', 0, 0, 0)
    except:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hotot', 0, 0, 0)
        
    agent.init_notify()
    app = Hotot()
    agent.app = app
    if HAS_INDICATOR:
        indicator = appindicator.Indicator('hotot',
                                            'hotot',
                                            appindicator.CATEGORY_COMMUNICATIONS)
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_icon(utils.get_ui_object('image/ic24_hotot_mono_light.svg'))
        indicator.set_attention_icon(utils.get_ui_object('image/ic24_hotot_mono_dark.svg'))
        indicator.set_menu(app.menu_tray)
        app.indicator = indicator

    from dbus.mainloop.glib import DBusGMainLoop
    DBusGMainLoop(set_as_default=True)
    HDService = HototDbusService(app)

    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 4
0
def main():
    global ENABLE_DEV_TOOLS
    ENABLE_DEV_TOOLS = False
    for arg in sys.argv[1:]:
        if arg in ('-h', '--help'):
            usage()
            sys.exit()
        elif arg in ('-d', '--dev'):
            ENABLE_DEV_TOOLS = True
        else:
            print "hotot: unrecognized option '%s'" % arg
            usage()
            sys.exit(1)

    try:
        import i18n
    except:
        from gettext import gettext as _

    try:
        import prctl
        prctl.set_name('hotot')
    except:
        pass

    Gdk.threads_init()
    config.loads();

    agent.init_notify()
    app = Hotot()
    agent.app = app
    
    Gdk.threads_enter()
    Gtk.main()
    Gdk.threads_leave()
Ejemplo n.º 5
0
def main():
    DBusGMainLoop(set_as_default=True)

    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    try:
        import ctypes
        libc = ctypes.CDLL('libc.so.6')
        libc.prctl(15, 'hotot', 0, 0, 0)
    except:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hotot', 0, 0, 0)

    agent.init_notify()
    app = Hotot()
    agent.app = app
    if HAS_INDICATOR:
        indicator = appindicator.Indicator('hotot',
                                            'hotot',
                                            appindicator.CATEGORY_COMMUNICATIONS,
                                            utils.get_ui_object('image'))
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_icon('ic24_hotot_mono_light')
        indicator.set_attention_icon('ic24_hotot_mono_light_blink')
        indicator.set_menu(app.menu_tray)
        app.indicator = indicator


    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 6
0
def main():
    DBusGMainLoop(set_as_default=True)

    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    try:
        import ctypes
        libc = ctypes.CDLL('libc.so.6')
        libc.prctl(15, 'hermelin', 0, 0, 0)
    except:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hermelin', 0, 0, 0)

    agent.init_notify()
    app = Hermelin()
    agent.app = app
    if HAS_INDICATOR:
        indicator = appindicator.Indicator('hermelin',
                                            'hermelin',
                                            appindicator.CATEGORY_COMMUNICATIONS,
                                            utils.get_ui_object('image'))
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_icon('ic24_hermelin_mono_light')
        indicator.set_attention_icon('ic24_hermelin_mono_light_blink')
        indicator.set_menu(app.menu_tray)
        app.indicator = indicator


    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 7
0
def test_decoder(config_string, check_params):
    param = config.loads(config_string)
    for nest_key, answer in check_params.items():
        nest_keys = nest_key.split('.')
        temp_dict = param
        for key in nest_keys:
            temp_dict = temp_dict[key]

        assert temp_dict == answer, 'Incorrect value (Key:{nest_key})'.format(
            nest_key=nest_key)
Ejemplo n.º 8
0
def crack_config(params):
    if params[1] == 'dumps':
        config.dumps()
    elif params[1] == 'loads': # useless
        config.loads()
    elif params[1] == 'push_prefs':
        config.loads()
        push_prefs()
    elif params[1] == 'save_prefs':
        prefs = db.unserialize_dict(params[2])
        config.save_prefs(prefs)
        apply_prefs()
    elif params[1] == 'restore_defaults':
        config.restore_defaults()
        apply_config()
        push_prefs()
    elif params[1] == 'set_opts':
        opts = json.loads(urllib2.unquote(params[2]))
        for key, value in opts.items():
            config.set(key, value)
    pass
Ejemplo n.º 9
0
def main():
    DBusGMainLoop(set_as_default=True)

    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    try:
        import ctypes
        libc = ctypes.CDLL('libc.so.6')
        libc.prctl(15, 'hotot', 0, 0, 0)
    except:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hotot', 0, 0, 0)

    agent.init_notify()
    app = Hotot()
    agent.app = app
    if HAS_INDICATOR:
        indicator = appindicator.Indicator('hotot',
                                            'hotot',
                                            appindicator.CATEGORY_COMMUNICATIONS,
                                            utils.get_ui_object('image'))
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_icon('ic24_hotot_mono_light')
        indicator.set_attention_icon('ic24_hotot_mono_light_blink')
        indicator.set_menu(app.menu_tray)
        app.indicator = indicator

    # Set display functions (MeMenu)
    if HAS_MEMENU:
        global ind_server, indicator_unread
        ind_server.connect("server-display", app.on_mitem_resume_activate)
        indicator_unread.connect("user-display", app.on_mitem_resume_activate) 

    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 10
0
def main():
    global HAS_INDICATOR
    gtk.gdk.threads_init()
    config.loads();
    try:
        import dl
        libc = dl.open('/lib/libc.so.6')
        libc.call('prctl', 15, 'hotot', 0, 0, 0)
    except:
        pass
    agent.init_notify()
    app = Hotot()
    agent.app = app
    if HAS_INDICATOR:
        indicator = appindicator.Indicator('hotot',
                                           'hotot',
                                           appindicator.CATEGORY_COMMUNICATIONS)
        indicator.set_status(appindicator.STATUS_ACTIVE)
        indicator.set_attention_icon(utils.get_ui_object('image/ic24_hotot_mono_light.svg'))
        indicator.set_menu(app.menu_tray)
    gtk.gdk.threads_enter()
    gtk.main()
    gtk.gdk.threads_leave()
Ejemplo n.º 11
0
def test_decoder_list_expansion(config_string, check_params):
    param = config.loads(config_string)
    for nest_key, answer in check_params.items():
        nest_keys = nest_key.split('.')
        temp_dict = param
        for key in nest_keys:
            temp_dict = temp_dict[key]

        if isinstance(answer, list):
            for i, (val, ans) in enumerate(zip(temp_dict, answer)):
                assert val == ans, \
                  'Incorrect value (Key:{nest_key}[{index}], {list})'.format(nest_key=nest_key, index=i, list=temp_dict)
        else:
            assert temp_dict == answer, 'Incorrect value (Key:{nest_key})'.format(
                nest_key=nest_key)