From 80190bf944977de1315df5f0d35438de29bac010 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 10 Aug 2008 22:50:29 +0000 Subject: Several pylint fixes. --- (limited to 'src/sugar/presence/presenceservice.py') diff --git a/src/sugar/presence/presenceservice.py b/src/sugar/presence/presenceservice.py index fb59a42..50f0f7f 100644 --- a/src/sugar/presence/presenceservice.py +++ b/src/sugar/presence/presenceservice.py @@ -178,7 +178,7 @@ class PresenceService(gobject.GObject): self._del_object, object_path) try: # Pre-fill the activity's ID - foo = obj.props.id + activity_id = obj.props.id except dbus.exceptions.DBusException: logging.debug('Cannot get the activity ID') else: @@ -239,9 +239,11 @@ class PresenceService(gobject.GObject): gobject.idle_add(self._emit_activity_invitation_signal, activity_path, buddy_path, message) - def _emit_private_invitation_signal(self, bus_name, connection, channel, chan_type): + def _emit_private_invitation_signal(self, bus_name, connection, + channel, chan_type): """Emit GObject event with bus_name, connection and channel""" - self.emit('private-invitation', bus_name, connection, channel, chan_type) + self.emit('private-invitation', bus_name, connection, + channel, chan_type) return False def _private_invitation_cb(self, bus_name, connection, channel, chan_type): @@ -469,7 +471,7 @@ class PresenceService(gobject.GObject): (activity.get_id(), err)) self.emit("activity-shared", False, None, err) - def share_activity(self, activity, properties={}, private=True): + def share_activity(self, activity, properties=None, private=True): """Ask presence service to ask the activity to share itself publicly. Uses the AdvertiseActivity method on the service to ask for the @@ -484,6 +486,9 @@ class PresenceService(gobject.GObject): """ actid = activity.get_id() + if properties is None: + properties = {} + # Ensure the activity is not already shared/joined for obj in self._objcache.values(): if not isinstance(object, Activity): @@ -584,7 +589,7 @@ class _MockPresenceService(gobject.GObject): def get_owner(self): return None - def share_activity(self, activity, properties={}): + def share_activity(self, activity, properties=None): return None _ps = None -- cgit v0.9.1