def init(): conn_watcher = connection_watcher.get_instance() conn_watcher.connect('connection-added', _connection_added_cb) conn_watcher.connect('connection-removed', _connection_removed_cb) for connection in conn_watcher.get_connections(): _monitor_connection(connection)
def init(): conn_watcher = connection_watcher.get_instance() conn_watcher.connect('connection-added', _connection_added_cb) conn_watcher.connect('connection-removed', _connection_removed_cb) for connection in conn_watcher.get_connections(): _monitor_connection(connection)
def file_transfer_available(): conn_watcher = connection_watcher.get_instance() for connection in conn_watcher.get_connections(): try: properties_iface = connection[dbus.PROPERTIES_IFACE] properties = properties_iface.GetAll(CONNECTION_INTERFACE_REQUESTS) except dbus.DBusException as e: logging.exception(e) continue classes = properties["RequestableChannelClasses"] for prop, allowed_prop in classes: channel_type = prop.get(CHANNEL + ".ChannelType", "") target_handle_type = prop.get(CHANNEL + ".TargetHandleType", "") if ( len(prop) == 2 and channel_type == CHANNEL_TYPE_FILE_TRANSFER and target_handle_type == CONNECTION_HANDLE_TYPE_CONTACT ): return True return False
def file_transfer_available(): conn_watcher = connection_watcher.get_instance() for connection in conn_watcher.get_connections(): try: properties_iface = connection[ dbus.PROPERTIES_IFACE] properties = properties_iface.GetAll( CONNECTION_INTERFACE_REQUESTS) except dbus.DBusException as e: logging.exception(e) continue classes = properties['RequestableChannelClasses'] for prop, allowed_prop in classes: channel_type = prop.get(CHANNEL + '.ChannelType', '') target_handle_type = prop.get(CHANNEL + '.TargetHandleType', '') if len(prop) == 2 and \ channel_type == CHANNEL_TYPE_FILE_TRANSFER and \ target_handle_type == CONNECTION_HANDLE_TYPE_CONTACT: return True return False
def init(): conn_watcher = connection_watcher.get_instance() conn_watcher.connect('connection-added', _connection_added_cb) conn_watcher.connect('connection-removed', _connection_removed_cb) for connection in conn_watcher.get_connections(): _monitor_connection(connection) client_handler = telepathyclient.get_instance() client_handler.got_dispatch_operation.connect(_got_dispatch_operation_cb)
def file_transfer_available(): conn_watcher = connection_watcher.get_instance() for connection in conn_watcher.get_connections(): properties_iface = connection[dbus.PROPERTIES_IFACE] properties = properties_iface.GetAll(CONNECTION_INTERFACE_REQUESTS) classes = properties['RequestableChannelClasses'] for prop, allowed_prop in classes: channel_type = prop.get(CHANNEL + '.ChannelType', '') target_handle_type = prop.get(CHANNEL + '.TargetHandleType', '') if len(prop) == 2 and \ channel_type == CHANNEL_TYPE_FILE_TRANSFER and \ target_handle_type == CONNECTION_HANDLE_TYPE_CONTACT: return True return False
def _sync_properties(self): conn_watcher = connection_watcher.get_instance() for connection in conn_watcher.get_connections(): self._sync_properties_on_connection(connection)
def _sync_properties(self): conn_watcher = connection_watcher.get_instance() for connection in conn_watcher.get_connections(): self._sync_properties_on_connection(connection)