예제 #1
0
    def run(self):
        self._mainloop = gobject.MainLoop(is_running=True)

        while self._mainloop.is_running():
            try:
                self._mainloop.run()
            except KeyboardInterrupt:
                aMSNCore().quit()
예제 #2
0
    def run(self):
        self._mainloop = gobject.MainLoop(is_running=True)

        while self._mainloop.is_running():
            try:
                self._mainloop.run()
            except KeyboardInterrupt:
                aMSNCore().quit()
예제 #3
0
    def __init__(self, default_background_color = None, default_color = None, default_font = None):
        self._elements = []
        from amsn2.core import aMSNCore
        self._core = aMSNCore()

        self._default_background_color = default_background_color
        self._default_color = default_color
        self._default_font = default_font

        if default_color is not None:
            self.reset_color()
        if default_background_color is not None:
            self.reset_background_color()
        if default_font is not None:
            self.reset_font()
예제 #4
0
    def __init__(self,
                 default_background_color=None,
                 default_color=None,
                 default_font=None):
        """
        @type default_background_color: object
        @type default_color: object
        @type default_font: object
        """
        self._elements = []
        from amsn2.core import aMSNCore
        self._core = aMSNCore()

        self._default_background_color = default_background_color
        self._default_color = default_color
        self._default_font = default_font

        if default_color is not None:
            self.reset_color()
        if default_background_color is not None:
            self.reset_background_color()
        if default_font is not None:
            self.reset_font()
예제 #5
0
파일: amsn2.py 프로젝트: elofreak/amsn2
        try:
            default_front_end = toolkit
            module_name = toolkits[toolkit]
            module = __import__(module_name)
            vars()[module_name] = module
            # Debug
            # print 'Imported toolkit "%s" with module "%s"' % (toolkit, module)
            break
        except ImportError:
        	# Debug
            # print 'Couldn\'t import %s - doesn\'t exist!' % module_name
            pass
        except TypeError:
            pass

    parser = optparse.OptionParser()
    parser.add_option("-a", "--account", dest="account",
                      default=None, help="The account's username to use")
    parser.add_option("-p", "--password", dest="password",
                      default=None, help="The account's password to use")
    parser.add_option("-f", "--front-end", dest="front_end",
                      default=default_front_end, help="The frontend to use")
    parser.add_option("-d", "--debug", action="store_true", dest="debug",
                      default=False, help="Show protocol debug")
    (options, args) = parser.parse_args()
    
    amsn = aMSNCore(options)
    
    amsn.run()

예제 #6
0
파일: amsn2.py 프로젝트: 19MiRkO91/amsn2
    parser = optparse.OptionParser(usage = "usage: %prog [options] [-- frontend_options]")
    parser.add_option("-a", "--account", dest="account",
                      default=None, help="The account's username to use")
    parser.add_option("-p", "--password", dest="password",
                      default=None, help="The account's password to use")
    parser.add_option("-f", "--front-end", dest="front_end",
                      default=default_front_end,
                      help="The frontend to use (default is %s)"%(default_front_end,))
    parser.add_option("-l", "--list", action="store_true",
                      dest="list_fe",
                      default=False, help="List Available front ends")
    parser.add_option("-d", "--debug-protocol", action="store_true",
                      dest="debug_protocol",
                      default=False, help="Show protocol debug")
    parser.add_option("-D", "--debug-amsn2", action="store_true", dest="debug_amsn2",
                      default=False, help="Show amsn2 debug")
    parser.add_option("-A", "--autologin", action="store_true", dest="auto_login",
                      default=False, help="Auto login with the credentials given")
    (options, args) = parser.parse_args()

    if options.list_fe:
        print "Available front ends are: %s" %(
            ', '.join(aMSNUserInterfaceManager.list_frontends()))
        sys.exit(0)

    amsn = aMSNCore(options, args)

    amsn.run()

예제 #7
0
                      default=False,
                      help="List Available front ends")
    parser.add_option("-d",
                      "--debug-protocol",
                      action="store_true",
                      dest="debug_protocol",
                      default=False,
                      help="Show protocol debug")
    parser.add_option("-D",
                      "--debug-amsn2",
                      action="store_true",
                      dest="debug_amsn2",
                      default=False,
                      help="Show amsn2 debug")
    parser.add_option("-A",
                      "--autologin",
                      action="store_true",
                      dest="auto_login",
                      default=False,
                      help="Auto login with the credentials given")
    (options, args) = parser.parse_args()

    if options.list_fe:
        print "Available front ends are: %s" % (', '.join(
            aMSNUserInterfaceManager.list_frontends()))
        sys.exit(0)

    amsn = aMSNCore(options, args)

    amsn.run()
예제 #8
0
파일: amsn2.py 프로젝트: Pythone/amsn2
                      dest="account",
                      default=None,
                      help="The account's username to use")
    parser.add_option("-p",
                      "--password",
                      dest="password",
                      default=None,
                      help="The account's password to use")
    parser.add_option("-f",
                      "--front-end",
                      dest="front_end",
                      default=default_front_end,
                      help="The frontend to use")
    parser.add_option("-d",
                      "--debug-protocol",
                      action="store_true",
                      dest="debug_protocol",
                      default=False,
                      help="Show protocol debug")
    parser.add_option("-D",
                      "--debug-amsn2",
                      action="store_true",
                      dest="debug_amsn2",
                      default=False,
                      help="Show amsn2 debug")
    (options, args) = parser.parse_args()

    amsn = aMSNCore(options)

    amsn.run()
예제 #9
0
 def on_keyboard_interrupt(self, signal, stack):
     aMSNCore().quit()