services/presence/buddy: remove trailing whitespace, wrap long lines
This commit is contained in:
parent
a5ba8541a4
commit
5bf10edaee
@ -90,7 +90,8 @@ class Buddy(ExportedGObject):
|
||||
|
||||
__gproperties__ = {
|
||||
_PROP_KEY : (str, None, None, None,
|
||||
gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT_ONLY),
|
||||
gobject.PARAM_READWRITE |
|
||||
gobject.PARAM_CONSTRUCT_ONLY),
|
||||
_PROP_ICON : (object, None, None, gobject.PARAM_READWRITE),
|
||||
_PROP_NICK : (str, None, None, None, gobject.PARAM_READWRITE),
|
||||
_PROP_COLOR : (str, None, None, None, gobject.PARAM_READWRITE),
|
||||
@ -135,7 +136,8 @@ class Buddy(ExportedGObject):
|
||||
if not kwargs.get(_PROP_KEY):
|
||||
raise ValueError("key required")
|
||||
|
||||
_ALLOWED_INIT_PROPS = [_PROP_NICK, _PROP_KEY, _PROP_ICON, _PROP_CURACT, _PROP_COLOR, _PROP_IP4_ADDRESS]
|
||||
_ALLOWED_INIT_PROPS = [_PROP_NICK, _PROP_KEY, _PROP_ICON,
|
||||
_PROP_CURACT, _PROP_COLOR, _PROP_IP4_ADDRESS]
|
||||
for (key, value) in kwargs.items():
|
||||
if key not in _ALLOWED_INIT_PROPS:
|
||||
_logger.debug("Invalid init property '%s'; ignoring..." % key)
|
||||
@ -383,7 +385,8 @@ class Buddy(ExportedGObject):
|
||||
return
|
||||
self._activities[actid] = activity
|
||||
# join/leave activity when it's validity changes
|
||||
sigid = activity.connect("validity-changed", self._activity_validity_changed_cb)
|
||||
sigid = activity.connect("validity-changed",
|
||||
self._activity_validity_changed_cb)
|
||||
self._activity_sigids[actid] = sigid
|
||||
if activity.props.valid:
|
||||
self.JoinedActivity(activity.object_path())
|
||||
@ -497,9 +500,12 @@ class GenericOwner(Buddy):
|
||||
__gtype_name__ = "GenericOwner"
|
||||
|
||||
__gproperties__ = {
|
||||
'registered' : (bool, None, None, False, gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
|
||||
'server' : (str, None, None, None, gobject.PARAM_READABLE | gobject.PARAM_CONSTRUCT),
|
||||
'key-hash' : (str, None, None, None, gobject.PARAM_READABLE | gobject.PARAM_CONSTRUCT)
|
||||
'registered' : (bool, None, None, False,
|
||||
gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT),
|
||||
'server' : (str, None, None, None,
|
||||
gobject.PARAM_READABLE | gobject.PARAM_CONSTRUCT),
|
||||
'key-hash' : (str, None, None, None,
|
||||
gobject.PARAM_READABLE | gobject.PARAM_CONSTRUCT)
|
||||
}
|
||||
|
||||
def __init__(self, ps, bus_name, object_id, **kwargs):
|
||||
@ -527,7 +533,8 @@ class GenericOwner(Buddy):
|
||||
del kwargs["registered"]
|
||||
|
||||
self._ip4_addr_monitor = psutils.IP4AddressMonitor.get_instance()
|
||||
self._ip4_addr_monitor.connect("address-changed", self._ip4_address_changed_cb)
|
||||
self._ip4_addr_monitor.connect("address-changed",
|
||||
self._ip4_address_changed_cb)
|
||||
if self._ip4_addr_monitor.props.address:
|
||||
kwargs["ip4-address"] = self._ip4_addr_monitor.props.address
|
||||
|
||||
@ -603,9 +610,9 @@ class ShellOwner(GenericOwner):
|
||||
icon = f.read()
|
||||
f.close()
|
||||
|
||||
GenericOwner.__init__(self, ps, bus_name, object_id, key=key, nick=nick,
|
||||
color=color, icon=icon, server=server, key_hash=key_hash,
|
||||
registered=registered)
|
||||
GenericOwner.__init__(self, ps, bus_name, object_id, key=key,
|
||||
nick=nick, color=color, icon=icon, server=server,
|
||||
key_hash=key_hash, registered=registered)
|
||||
|
||||
# Connect to the shell to get notifications on Owner object
|
||||
# property changes
|
||||
@ -640,9 +647,12 @@ class ShellOwner(GenericOwner):
|
||||
"""
|
||||
obj = self._bus.get_object(self._SHELL_SERVICE, self._SHELL_PATH)
|
||||
self._shell_owner = dbus.Interface(obj, self._SHELL_OWNER_INTERFACE)
|
||||
self._shell_owner.connect_to_signal('IconChanged', self._icon_changed_cb)
|
||||
self._shell_owner.connect_to_signal('ColorChanged', self._color_changed_cb)
|
||||
self._shell_owner.connect_to_signal('NickChanged', self._nick_changed_cb)
|
||||
self._shell_owner.connect_to_signal('IconChanged',
|
||||
self._icon_changed_cb)
|
||||
self._shell_owner.connect_to_signal('ColorChanged',
|
||||
self._color_changed_cb)
|
||||
self._shell_owner.connect_to_signal('NickChanged',
|
||||
self._nick_changed_cb)
|
||||
self._shell_owner.connect_to_signal('CurrentActivityChanged',
|
||||
self._cur_activity_changed_cb)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user