Example #1
0
    def _on_object_added(self, object_manager, dbus_object):
        transfer_proxy = dbus_object.get_interface('org.bluez.obex.Transfer1')

        if transfer_proxy:
            transfer_path = transfer_proxy.get_object_path()
            transfer = Transfer(transfer_path)
            completed_sig = transfer.connect_signal('completed', self._on_transfer_completed, True)
            error_sig = transfer.connect_signal('error', self._on_transfer_completed, False)
            self.__signals[transfer_path] = (completed_sig, error_sig)

            dprint(transfer_path)
            self.emit('transfer-started', transfer_path)
Example #2
0
    def _on_object_added(self, object_manager, dbus_object):
        session_proxy = dbus_object.get_interface('org.bluez.obex.Session1')
        transfer_proxy = dbus_object.get_interface('org.bluez.obex.Transfer1')
        object_path = dbus_object.get_object_path()

        if transfer_proxy:
            logging.info(object_path)
            transfer = Transfer(object_path)
            transfer.connect_signal('completed', self._on_transfer_completed, True)
            transfer.connect_signal('error', self._on_transfer_completed, False)
            self.__transfers[object_path] = transfer
            self.emit('transfer-started', object_path)

        if session_proxy:
            logging.info(object_path)
            self.emit('session-added', object_path)
Example #3
0
    def _on_object_added(self, _object_manager: Gio.DBusObjectManager,
                         dbus_object: Gio.DBusObject) -> None:
        session_proxy = dbus_object.get_interface('org.bluez.obex.Session1')
        transfer_proxy = dbus_object.get_interface('org.bluez.obex.Transfer1')
        object_path = dbus_object.get_object_path()

        if transfer_proxy:
            logging.info(object_path)
            transfer = Transfer(obj_path=object_path)
            chandlerid = transfer.connect_signal('completed',
                                                 self._on_transfer_completed,
                                                 True)
            ehandlerid = transfer.connect_signal('error',
                                                 self._on_transfer_completed,
                                                 False)
            self.__transfers[object_path] = (transfer, (chandlerid,
                                                        ehandlerid))
            self.emit('transfer-started', object_path)

        if session_proxy:
            logging.info(object_path)
            self.emit('session-added', object_path)