pep8'd sugar3.presence
This commit is contained in:
parent
edbc8f53b3
commit
69a7aa8f68
@ -29,15 +29,15 @@ from dbus import PROPERTIES_IFACE
|
|||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from telepathy.client import Channel
|
from telepathy.client import Channel
|
||||||
from telepathy.interfaces import CHANNEL, \
|
from telepathy.interfaces import CHANNEL, \
|
||||||
CHANNEL_INTERFACE_GROUP, \
|
CHANNEL_INTERFACE_GROUP, \
|
||||||
CHANNEL_TYPE_TUBES, \
|
CHANNEL_TYPE_TUBES, \
|
||||||
CHANNEL_TYPE_TEXT, \
|
CHANNEL_TYPE_TEXT, \
|
||||||
CONNECTION, \
|
CONNECTION, \
|
||||||
PROPERTIES_INTERFACE
|
PROPERTIES_INTERFACE
|
||||||
from telepathy.constants import CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, \
|
from telepathy.constants import CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, \
|
||||||
HANDLE_TYPE_ROOM, \
|
HANDLE_TYPE_ROOM, \
|
||||||
HANDLE_TYPE_CONTACT, \
|
HANDLE_TYPE_CONTACT, \
|
||||||
PROPERTY_FLAG_WRITE
|
PROPERTY_FLAG_WRITE
|
||||||
|
|
||||||
from sugar3.presence.buddy import Buddy
|
from sugar3.presence.buddy import Buddy
|
||||||
|
|
||||||
@ -64,13 +64,13 @@ class Activity(GObject.GObject):
|
|||||||
"""
|
"""
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'buddy-joined': (GObject.SignalFlags.RUN_FIRST, None,
|
'buddy-joined': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
'buddy-left': (GObject.SignalFlags.RUN_FIRST, None,
|
'buddy-left': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
'new-channel': (GObject.SignalFlags.RUN_FIRST, None,
|
'new-channel': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
'joined': (GObject.SignalFlags.RUN_FIRST, None,
|
'joined': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT])),
|
||||||
}
|
}
|
||||||
|
|
||||||
__gproperties__ = {
|
__gproperties__ = {
|
||||||
@ -120,22 +120,22 @@ class Activity(GObject.GObject):
|
|||||||
def _start_tracking_properties(self):
|
def _start_tracking_properties(self):
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
self._get_properties_call = bus.call_async(
|
self._get_properties_call = bus.call_async(
|
||||||
self.telepathy_conn.requested_bus_name,
|
self.telepathy_conn.requested_bus_name,
|
||||||
self.telepathy_conn.object_path,
|
self.telepathy_conn.object_path,
|
||||||
CONN_INTERFACE_ACTIVITY_PROPERTIES,
|
CONN_INTERFACE_ACTIVITY_PROPERTIES,
|
||||||
'GetProperties',
|
'GetProperties',
|
||||||
'u',
|
'u',
|
||||||
(self.room_handle,),
|
(self.room_handle,),
|
||||||
reply_handler=self.__got_properties_cb,
|
reply_handler=self.__got_properties_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
utf8_strings=True)
|
utf8_strings=True)
|
||||||
|
|
||||||
# As only one Activity instance is needed per activity process,
|
# As only one Activity instance is needed per activity process,
|
||||||
# we can afford listening to ActivityPropertiesChanged like this.
|
# we can afford listening to ActivityPropertiesChanged like this.
|
||||||
self.telepathy_conn.connect_to_signal(
|
self.telepathy_conn.connect_to_signal(
|
||||||
'ActivityPropertiesChanged',
|
'ActivityPropertiesChanged',
|
||||||
self.__activity_properties_changed_cb,
|
self.__activity_properties_changed_cb,
|
||||||
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
||||||
|
|
||||||
def __activity_properties_changed_cb(self, room_handle, properties):
|
def __activity_properties_changed_cb(self, room_handle, properties):
|
||||||
_logger.debug('%r: Activity properties changed to %r', self,
|
_logger.debug('%r: Activity properties changed to %r', self,
|
||||||
@ -257,10 +257,12 @@ class Activity(GObject.GObject):
|
|||||||
if not self._joined:
|
if not self._joined:
|
||||||
raise RuntimeError('Cannot invite a buddy to an activity that is'
|
raise RuntimeError('Cannot invite a buddy to an activity that is'
|
||||||
'not shared.')
|
'not shared.')
|
||||||
self.telepathy_text_chan.AddMembers([buddy.contact_handle], message,
|
self.telepathy_text_chan.AddMembers(
|
||||||
dbus_interface=CHANNEL_INTERFACE_GROUP,
|
[buddy.contact_handle], message,
|
||||||
reply_handler=partial(self.__invite_cb, response_cb),
|
dbus_interface=CHANNEL_INTERFACE_GROUP,
|
||||||
error_handler=partial(self.__invite_cb, response_cb))
|
reply_handler=partial(
|
||||||
|
self.__invite_cb, response_cb),
|
||||||
|
error_handler=partial(self.__invite_cb, response_cb))
|
||||||
|
|
||||||
def __invite_cb(self, response_cb, error=None):
|
def __invite_cb(self, response_cb, error=None):
|
||||||
response_cb(error)
|
response_cb(error)
|
||||||
@ -305,7 +307,8 @@ class Activity(GObject.GObject):
|
|||||||
|
|
||||||
def _resolve_handles(self, input_handles, reply_cb):
|
def _resolve_handles(self, input_handles, reply_cb):
|
||||||
def get_handle_owners_cb(handles):
|
def get_handle_owners_cb(handles):
|
||||||
self.telepathy_conn.InspectHandles(HANDLE_TYPE_CONTACT, handles,
|
self.telepathy_conn.InspectHandles(
|
||||||
|
HANDLE_TYPE_CONTACT, handles,
|
||||||
reply_handler=reply_cb,
|
reply_handler=reply_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
dbus_interface=CONNECTION)
|
dbus_interface=CONNECTION)
|
||||||
@ -407,7 +410,7 @@ class Activity(GObject.GObject):
|
|||||||
self.telepathy_tubes_chan = share_command.tubes_channel
|
self.telepathy_tubes_chan = share_command.tubes_channel
|
||||||
self._channel_self_handle = share_command.channel_self_handle
|
self._channel_self_handle = share_command.channel_self_handle
|
||||||
self._text_channel_group_flags = \
|
self._text_channel_group_flags = \
|
||||||
share_command.text_channel_group_flags
|
share_command.text_channel_group_flags
|
||||||
self._publish_properties()
|
self._publish_properties()
|
||||||
self._start_tracking_properties()
|
self._start_tracking_properties()
|
||||||
self._start_tracking_buddies()
|
self._start_tracking_buddies()
|
||||||
@ -430,9 +433,9 @@ class Activity(GObject.GObject):
|
|||||||
properties['private'] = self._private
|
properties['private'] = self._private
|
||||||
|
|
||||||
self.telepathy_conn.SetProperties(
|
self.telepathy_conn.SetProperties(
|
||||||
self.room_handle,
|
self.room_handle,
|
||||||
properties,
|
properties,
|
||||||
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
||||||
|
|
||||||
def __share_error_cb(self, share_activity_error_cb, error):
|
def __share_error_cb(self, share_activity_error_cb, error):
|
||||||
logging.debug('%r: Share failed because: %s', self, error)
|
logging.debug('%r: Share failed because: %s', self, error)
|
||||||
@ -557,21 +560,26 @@ class _JoinCommand(_BaseCommand):
|
|||||||
raise RuntimeError('This command has already finished')
|
raise RuntimeError('This command has already finished')
|
||||||
|
|
||||||
self._connection.Get(CONNECTION, 'SelfHandle',
|
self._connection.Get(CONNECTION, 'SelfHandle',
|
||||||
reply_handler=self.__get_self_handle_cb,
|
reply_handler=self.__get_self_handle_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
dbus_interface=PROPERTIES_IFACE)
|
dbus_interface=PROPERTIES_IFACE)
|
||||||
|
|
||||||
def __get_self_handle_cb(self, handle):
|
def __get_self_handle_cb(self, handle):
|
||||||
self._global_self_handle = handle
|
self._global_self_handle = handle
|
||||||
|
|
||||||
self._connection.RequestChannel(CHANNEL_TYPE_TEXT,
|
self._connection.RequestChannel(
|
||||||
HANDLE_TYPE_ROOM, self.room_handle, True,
|
CHANNEL_TYPE_TEXT,
|
||||||
|
HANDLE_TYPE_ROOM,
|
||||||
|
self.room_handle, True,
|
||||||
reply_handler=self.__create_text_channel_cb,
|
reply_handler=self.__create_text_channel_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
dbus_interface=CONNECTION)
|
dbus_interface=CONNECTION)
|
||||||
|
|
||||||
self._connection.RequestChannel(CHANNEL_TYPE_TUBES,
|
self._connection.RequestChannel(
|
||||||
HANDLE_TYPE_ROOM, self.room_handle, True,
|
CHANNEL_TYPE_TUBES,
|
||||||
|
HANDLE_TYPE_ROOM,
|
||||||
|
self.room_handle,
|
||||||
|
True,
|
||||||
reply_handler=self.__create_tubes_channel_cb,
|
reply_handler=self.__create_tubes_channel_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
dbus_interface=CONNECTION)
|
dbus_interface=CONNECTION)
|
||||||
@ -600,7 +608,7 @@ class _JoinCommand(_BaseCommand):
|
|||||||
|
|
||||||
def _tubes_ready(self):
|
def _tubes_ready(self):
|
||||||
if self.text_channel is None or \
|
if self.text_channel is None or \
|
||||||
self.tubes_channel is None:
|
self.tubes_channel is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
_logger.debug('%r: finished setting up tubes', self)
|
_logger.debug('%r: finished setting up tubes', self)
|
||||||
@ -633,9 +641,10 @@ class _JoinCommand(_BaseCommand):
|
|||||||
if self_handle in local_pending:
|
if self_handle in local_pending:
|
||||||
_logger.debug('%r: We are in local pending - entering', self)
|
_logger.debug('%r: We are in local pending - entering', self)
|
||||||
group.AddMembers([self_handle], '',
|
group.AddMembers([self_handle], '',
|
||||||
reply_handler=lambda: None,
|
reply_handler=lambda: None,
|
||||||
error_handler=lambda e: self._join_failed_cb(e,
|
error_handler=lambda e: self._join_failed_cb(
|
||||||
'got_all_members AddMembers'))
|
e,
|
||||||
|
'got_all_members AddMembers'))
|
||||||
|
|
||||||
if members:
|
if members:
|
||||||
self.__text_channel_members_changed_cb('', members, (),
|
self.__text_channel_members_changed_cb('', members, (),
|
||||||
|
@ -27,8 +27,8 @@ from gi.repository import GObject
|
|||||||
import dbus
|
import dbus
|
||||||
from gi.repository import GConf
|
from gi.repository import GConf
|
||||||
from telepathy.interfaces import CONNECTION, \
|
from telepathy.interfaces import CONNECTION, \
|
||||||
CONNECTION_INTERFACE_ALIASING, \
|
CONNECTION_INTERFACE_ALIASING, \
|
||||||
CONNECTION_INTERFACE_CONTACTS
|
CONNECTION_INTERFACE_CONTACTS
|
||||||
from telepathy.constants import HANDLE_TYPE_CONTACT
|
from telepathy.constants import HANDLE_TYPE_CONTACT
|
||||||
|
|
||||||
from sugar3.presence.connectionmanager import get_connection_manager
|
from sugar3.presence.connectionmanager import get_connection_manager
|
||||||
@ -58,11 +58,11 @@ class BaseBuddy(GObject.GObject):
|
|||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'joined-activity': (GObject.SignalFlags.RUN_FIRST, None,
|
'joined-activity': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
'left-activity': (GObject.SignalFlags.RUN_FIRST, None,
|
'left-activity': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
'property-changed': (GObject.SignalFlags.RUN_FIRST, None,
|
'property-changed': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT])),
|
([GObject.TYPE_PYOBJECT])),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -165,27 +165,27 @@ class Buddy(BaseBuddy):
|
|||||||
self.contact_handle = handles[0]
|
self.contact_handle = handles[0]
|
||||||
|
|
||||||
self._get_properties_call = bus.call_async(
|
self._get_properties_call = bus.call_async(
|
||||||
connection_name,
|
connection_name,
|
||||||
connection.object_path,
|
connection.object_path,
|
||||||
CONN_INTERFACE_BUDDY_INFO,
|
CONN_INTERFACE_BUDDY_INFO,
|
||||||
'GetProperties',
|
'GetProperties',
|
||||||
'u',
|
'u',
|
||||||
(self.contact_handle,),
|
(self.contact_handle,),
|
||||||
reply_handler=self.__got_properties_cb,
|
reply_handler=self.__got_properties_cb,
|
||||||
error_handler=self.__error_handler_cb,
|
error_handler=self.__error_handler_cb,
|
||||||
utf8_strings=True,
|
utf8_strings=True,
|
||||||
byte_arrays=True)
|
byte_arrays=True)
|
||||||
|
|
||||||
self._get_attributes_call = bus.call_async(
|
self._get_attributes_call = bus.call_async(
|
||||||
connection_name,
|
connection_name,
|
||||||
connection.object_path,
|
connection.object_path,
|
||||||
CONNECTION_INTERFACE_CONTACTS,
|
CONNECTION_INTERFACE_CONTACTS,
|
||||||
'GetContactAttributes',
|
'GetContactAttributes',
|
||||||
'auasb',
|
'auasb',
|
||||||
([self.contact_handle], [CONNECTION_INTERFACE_ALIASING],
|
([self.contact_handle], [CONNECTION_INTERFACE_ALIASING],
|
||||||
False),
|
False),
|
||||||
reply_handler=self.__got_attributes_cb,
|
reply_handler=self.__got_attributes_cb,
|
||||||
error_handler=self.__error_handler_cb)
|
error_handler=self.__error_handler_cb)
|
||||||
|
|
||||||
def __got_properties_cb(self, properties):
|
def __got_properties_cb(self, properties):
|
||||||
_logger.debug('__got_properties_cb %r', properties)
|
_logger.debug('__got_properties_cb %r', properties)
|
||||||
|
@ -24,7 +24,7 @@ from functools import partial
|
|||||||
import dbus
|
import dbus
|
||||||
from dbus import PROPERTIES_IFACE
|
from dbus import PROPERTIES_IFACE
|
||||||
from telepathy.interfaces import ACCOUNT, \
|
from telepathy.interfaces import ACCOUNT, \
|
||||||
ACCOUNT_MANAGER
|
ACCOUNT_MANAGER
|
||||||
from telepathy.constants import CONNECTION_STATUS_CONNECTED
|
from telepathy.constants import CONNECTION_STATUS_CONNECTED
|
||||||
|
|
||||||
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
||||||
@ -52,7 +52,8 @@ class ConnectionManager(object):
|
|||||||
for account_path in account_paths:
|
for account_path in account_paths:
|
||||||
obj = bus.get_object(ACCOUNT_MANAGER_SERVICE, account_path)
|
obj = bus.get_object(ACCOUNT_MANAGER_SERVICE, account_path)
|
||||||
obj.connect_to_signal('AccountPropertyChanged',
|
obj.connect_to_signal('AccountPropertyChanged',
|
||||||
partial(self.__account_property_changed_cb, account_path))
|
partial(self.__account_property_changed_cb,
|
||||||
|
account_path))
|
||||||
connection_path = obj.Get(ACCOUNT, 'Connection')
|
connection_path = obj.Get(ACCOUNT, 'Connection')
|
||||||
if connection_path != '/':
|
if connection_path != '/':
|
||||||
self._track_connection(account_path, connection_path)
|
self._track_connection(account_path, connection_path)
|
||||||
@ -71,9 +72,10 @@ class ConnectionManager(object):
|
|||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
connection = bus.get_object(connection_name, connection_path)
|
connection = bus.get_object(connection_name, connection_path)
|
||||||
connection.connect_to_signal('StatusChanged',
|
connection.connect_to_signal('StatusChanged',
|
||||||
partial(self.__status_changed_cb, account_path))
|
partial(self.__status_changed_cb,
|
||||||
|
account_path))
|
||||||
self._connections_per_account[account_path] = \
|
self._connections_per_account[account_path] = \
|
||||||
Connection(account_path, connection)
|
Connection(account_path, connection)
|
||||||
|
|
||||||
account = bus.get_object(ACCOUNT_MANAGER_SERVICE, account_path)
|
account = bus.get_object(ACCOUNT_MANAGER_SERVICE, account_path)
|
||||||
status = account.Get(ACCOUNT, 'ConnectionStatus')
|
status = account.Get(ACCOUNT, 'ConnectionStatus')
|
||||||
@ -112,6 +114,8 @@ class ConnectionManager(object):
|
|||||||
|
|
||||||
|
|
||||||
_connection_manager = None
|
_connection_manager = None
|
||||||
|
|
||||||
|
|
||||||
def get_connection_manager():
|
def get_connection_manager():
|
||||||
global _connection_manager
|
global _connection_manager
|
||||||
if not _connection_manager:
|
if not _connection_manager:
|
||||||
|
@ -33,8 +33,8 @@ from sugar3.presence.activity import Activity
|
|||||||
from sugar3.presence.connectionmanager import get_connection_manager
|
from sugar3.presence.connectionmanager import get_connection_manager
|
||||||
|
|
||||||
from telepathy.interfaces import ACCOUNT, \
|
from telepathy.interfaces import ACCOUNT, \
|
||||||
ACCOUNT_MANAGER, \
|
ACCOUNT_MANAGER, \
|
||||||
CONNECTION
|
CONNECTION
|
||||||
from telepathy.constants import HANDLE_TYPE_CONTACT
|
from telepathy.constants import HANDLE_TYPE_CONTACT
|
||||||
|
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ class PresenceService(GObject.GObject):
|
|||||||
"""Provides simplified access to the Telepathy framework to activities"""
|
"""Provides simplified access to the Telepathy framework to activities"""
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'activity-shared': (GObject.SignalFlags.RUN_FIRST, None,
|
'activity-shared': (GObject.SignalFlags.RUN_FIRST, None,
|
||||||
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT,
|
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT,
|
||||||
GObject.TYPE_PYOBJECT])),
|
GObject.TYPE_PYOBJECT])),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -78,15 +78,15 @@ class PresenceService(GObject.GObject):
|
|||||||
else:
|
else:
|
||||||
connection_manager = get_connection_manager()
|
connection_manager = get_connection_manager()
|
||||||
connections_per_account = \
|
connections_per_account = \
|
||||||
connection_manager.get_connections_per_account()
|
connection_manager.get_connections_per_account()
|
||||||
for account_path, connection in connections_per_account.items():
|
for account_path, connection in connections_per_account.items():
|
||||||
if not connection.connected:
|
if not connection.connected:
|
||||||
continue
|
continue
|
||||||
logging.debug('Calling GetActivity on %s', account_path)
|
logging.debug('Calling GetActivity on %s', account_path)
|
||||||
try:
|
try:
|
||||||
room_handle = connection.connection.GetActivity(
|
room_handle = connection.connection.GetActivity(
|
||||||
activity_id,
|
activity_id,
|
||||||
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
dbus_interface=CONN_INTERFACE_ACTIVITY_PROPERTIES)
|
||||||
except dbus.exceptions.DBusException, e:
|
except dbus.exceptions.DBusException, e:
|
||||||
name = 'org.freedesktop.Telepathy.Error.NotAvailable'
|
name = 'org.freedesktop.Telepathy.Error.NotAvailable'
|
||||||
if e.get_dbus_name() == name:
|
if e.get_dbus_name() == name:
|
||||||
@ -157,9 +157,10 @@ class PresenceService(GObject.GObject):
|
|||||||
if connection_path == tp_conn_path:
|
if connection_path == tp_conn_path:
|
||||||
connection_name = connection_path.replace('/', '.')[1:]
|
connection_name = connection_path.replace('/', '.')[1:]
|
||||||
connection = bus.get_object(connection_name, connection_path)
|
connection = bus.get_object(connection_name, connection_path)
|
||||||
contact_ids = connection.InspectHandles(HANDLE_TYPE_CONTACT,
|
contact_ids = connection.InspectHandles(
|
||||||
[handle],
|
HANDLE_TYPE_CONTACT,
|
||||||
dbus_interface=CONNECTION)
|
[handle],
|
||||||
|
dbus_interface=CONNECTION)
|
||||||
return self.get_buddy(account_path, contact_ids[0])
|
return self.get_buddy(account_path, contact_ids[0])
|
||||||
|
|
||||||
raise ValueError('Unknown buddy in connection %s with handle %d',
|
raise ValueError('Unknown buddy in connection %s with handle %d',
|
||||||
@ -203,7 +204,7 @@ class PresenceService(GObject.GObject):
|
|||||||
|
|
||||||
connection_manager = get_connection_manager()
|
connection_manager = get_connection_manager()
|
||||||
account_path, connection = \
|
account_path, connection = \
|
||||||
connection_manager.get_preferred_connection()
|
connection_manager.get_preferred_connection()
|
||||||
|
|
||||||
if connection is None:
|
if connection is None:
|
||||||
self.emit('activity-shared', False, None,
|
self.emit('activity-shared', False, None,
|
||||||
|
@ -49,7 +49,7 @@ class SugarTubeConnection(TubeConnection):
|
|||||||
# It's me, just get my global handle
|
# It's me, just get my global handle
|
||||||
handle = self._conn.GetSelfHandle()
|
handle = self._conn.GetSelfHandle()
|
||||||
elif self._group_iface.GetGroupFlags() & \
|
elif self._group_iface.GetGroupFlags() & \
|
||||||
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES:
|
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES:
|
||||||
# The group (channel) has channel specific handles
|
# The group (channel) has channel specific handles
|
||||||
handle = self._group_iface.GetHandleOwners([cs_handle])[0]
|
handle = self._group_iface.GetHandleOwners([cs_handle])[0]
|
||||||
else:
|
else:
|
||||||
|
@ -62,11 +62,13 @@ class TubeConnection(Connection):
|
|||||||
# pylint: disable=W0201
|
# pylint: disable=W0201
|
||||||
# Confused by __new__
|
# Confused by __new__
|
||||||
self.self_handle = handle
|
self.self_handle = handle
|
||||||
match = self._tubes_iface.connect_to_signal('DBusNamesChanged',
|
match = self._tubes_iface.connect_to_signal(
|
||||||
self._on_dbus_names_changed)
|
'DBusNamesChanged',
|
||||||
self._tubes_iface.GetDBusNames(self.tube_id,
|
self._on_dbus_names_changed)
|
||||||
reply_handler=self._on_get_dbus_names_reply,
|
self._tubes_iface.GetDBusNames(
|
||||||
error_handler=self._on_get_dbus_names_error)
|
self.tube_id,
|
||||||
|
reply_handler=self._on_get_dbus_names_reply,
|
||||||
|
error_handler=self._on_get_dbus_names_error)
|
||||||
self._dbus_names_changed_match = match
|
self._dbus_names_changed_match = match
|
||||||
|
|
||||||
def _on_get_self_handle_error(self, e):
|
def _on_get_self_handle_error(self, e):
|
||||||
|
Loading…
Reference in New Issue
Block a user