Example #1
0
    def __init__(self, opts):
        self.logger = logging.getLogger('Skype4Py.api.posix_x11.SkypeAPI')
        SkypeAPIBase.__init__(self)
        finalize_opts(opts)

        # initialize threads if not done already by the user
        threads_init(gtk=False)

        # init Xlib display
        self.disp = x11.XOpenDisplay(None)
        if not self.disp:
            raise SkypeAPIError('Could not open XDisplay')
        self.win_root = x11.XDefaultRootWindow(self.disp)
        self.win_self = x11.XCreateSimpleWindow(self.disp, self.win_root, 100,
                                                100, 100, 100, 1, 0, 0)
        x11.XSelectInput(self.disp, self.win_root, PropertyChangeMask)
        self.win_skype = self.get_skype()
        ctrl = 'SKYPECONTROLAPI_MESSAGE'
        self.atom_msg = x11.XInternAtom(self.disp, ctrl, False)
        self.atom_msg_begin = x11.XInternAtom(self.disp, ctrl + '_BEGIN',
                                              False)

        self.loop_event = threading.Event()
        self.loop_timeout = 0.0001
        self.loop_break = False
Example #2
0
    def __init__(self, opts):
        self.logger = logging.getLogger('Skype4Py.api.posix_dbus.SkypeAPI')
        SkypeAPIBase.__init__(self)
        self.run_main_loop = opts.pop('RunMainLoop', True)
        system_bus = opts.pop('UseSystemBus', False)
        finalize_opts(opts)
        self.skype_in = self.skype_out = self.dbus_name_owner_watch = None

        # initialize glib multithreading support
        gobject.threads_init()
        dbus.glib.threads_init()

        # dbus-python calls object.__init__() with arguments passed to SessionBus(),
        # this throws a warning on newer Python versions; here we suppress it
        warnings.simplefilter('ignore')
        try:
            if system_bus:
                bus = dbus.SystemBus
            else:
                bus = dbus.SessionBus
            self.bus = bus(mainloop=DBusGMainLoop())
        finally:
            warnings.simplefilter('default')
        
        if self.run_main_loop:
            self.mainloop = gobject.MainLoop()
Example #3
0
 def __init__(self, opts):
     self.logger = logging.getLogger('Skype4Py.api.darwin.SkypeAPI')
     SkypeAPIBase.__init__(self)
     self.run_main_loop = opts.pop('RunMainLoop', True)
     finalize_opts(opts)
     self.center = CFDistributedNotificationCenter()
     self.is_available = False
     self.client_id = -1
Example #4
0
 def __init__(self, opts):
     self.logger = logging.getLogger('Skype4Py.api.windows.SkypeAPI')
     SkypeAPIBase.__init__(self)
     finalize_opts(opts)
     self.window_class = None
     self.hwnd = None
     self.skype = None
     self.wait = False
     self.SkypeControlAPIDiscover = windll.user32.RegisterWindowMessageA('SkypeControlAPIDiscover')
     self.SkypeControlAPIAttach = windll.user32.RegisterWindowMessageA('SkypeControlAPIAttach')
     windll.user32.GetWindowLongA.restype = c_ulong
Example #5
0
 def __init__(self, opts):
     self.logger = logging.getLogger('Skype4Py.api.windows.SkypeAPI')
     SkypeAPIBase.__init__(self)
     finalize_opts(opts)
     self.window_class = None
     self.hwnd = None
     self.skype = None
     self.wait = False
     self.SkypeControlAPIDiscover = windll.user32.RegisterWindowMessageA('SkypeControlAPIDiscover')
     self.SkypeControlAPIAttach = windll.user32.RegisterWindowMessageA('SkypeControlAPIAttach')
     windll.user32.GetWindowLongA.restype = c_ulong
Example #6
0
    def __init__(self, opts):
        self.logger = logging.getLogger("Skype4Py.api.posix_x11.SkypeAPI")
        SkypeAPIBase.__init__(self)
        finalize_opts(opts)

        # initialize threads if not done already by the user
        threads_init(gtk=False)

        # init Xlib display
        self.disp = x11.XOpenDisplay(None)
        if not self.disp:
            raise SkypeAPIError("Could not open XDisplay")
        self.win_root = x11.XDefaultRootWindow(self.disp)
        self.win_self = x11.XCreateSimpleWindow(self.disp, self.win_root, 100, 100, 100, 100, 1, 0, 0)
        x11.XSelectInput(self.disp, self.win_root, PropertyChangeMask)
        self.win_skype = self.get_skype()
        ctrl = "SKYPECONTROLAPI_MESSAGE"
        self.atom_msg = x11.XInternAtom(self.disp, ctrl, False)
        self.atom_msg_begin = x11.XInternAtom(self.disp, ctrl + "_BEGIN", False)

        self.loop_event = threading.Event()
        self.loop_timeout = 0.0001
        self.loop_break = False