style cleanup: prefer ' for strings
Tomeu prefers ' for strings, so let's use it wherever we don't have a good reason to use ". Reviewed-by: James Cameron <quozl@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
This commit is contained in:
@@ -180,7 +180,7 @@ class Activity(gobject.GObject):
|
||||
def do_get_property(self, pspec):
|
||||
"""Retrieve a particular property from our property dictionary"""
|
||||
|
||||
if pspec.name == "joined":
|
||||
if pspec.name == 'joined':
|
||||
return self._joined
|
||||
|
||||
if self._get_properties_call is not None:
|
||||
@@ -188,17 +188,17 @@ class Activity(gobject.GObject):
|
||||
'wants property %s', self, pspec.name)
|
||||
self._get_properties_call.block()
|
||||
|
||||
if pspec.name == "id":
|
||||
if pspec.name == 'id':
|
||||
return self._id
|
||||
elif pspec.name == "name":
|
||||
elif pspec.name == 'name':
|
||||
return self._name
|
||||
elif pspec.name == "color":
|
||||
elif pspec.name == 'color':
|
||||
return self._color
|
||||
elif pspec.name == "type":
|
||||
elif pspec.name == 'type':
|
||||
return self._type
|
||||
elif pspec.name == "tags":
|
||||
elif pspec.name == 'tags':
|
||||
return self._tags
|
||||
elif pspec.name == "private":
|
||||
elif pspec.name == 'private':
|
||||
return self._private
|
||||
|
||||
def do_set_property(self, pspec, val):
|
||||
@@ -206,16 +206,16 @@ class Activity(gobject.GObject):
|
||||
# FIXME: need an asynchronous API to set these properties,
|
||||
# particularly 'private'
|
||||
|
||||
if pspec.name == "name":
|
||||
if pspec.name == 'name':
|
||||
self._name = val
|
||||
elif pspec.name == "color":
|
||||
elif pspec.name == 'color':
|
||||
self._color = val
|
||||
elif pspec.name == "tags":
|
||||
elif pspec.name == 'tags':
|
||||
self._tags = val
|
||||
elif pspec.name == "private":
|
||||
elif pspec.name == 'private':
|
||||
self._private = val
|
||||
else:
|
||||
raise ValueError('Unknown property "%s"', pspec.name)
|
||||
raise ValueError('Unknown property %r', pspec.name)
|
||||
|
||||
self._publish_properties()
|
||||
|
||||
@@ -457,7 +457,7 @@ class Activity(gobject.GObject):
|
||||
# Leaving
|
||||
def __text_channel_closed_cb(self):
|
||||
self._joined = False
|
||||
self.emit("joined", False, "left activity")
|
||||
self.emit('joined', False, 'left activity')
|
||||
|
||||
def leave(self):
|
||||
"""Leave this shared activity"""
|
||||
|
||||
@@ -244,5 +244,5 @@ class Owner(BaseBuddy):
|
||||
BaseBuddy.__init__(self)
|
||||
|
||||
client = gconf.client_get_default()
|
||||
self.props.nick = client.get_string("/desktop/sugar/user/nick")
|
||||
self.props.color = client.get_string("/desktop/sugar/user/color")
|
||||
self.props.nick = client.get_string('/desktop/sugar/user/nick')
|
||||
self.props.color = client.get_string('/desktop/sugar/user/color')
|
||||
|
||||
@@ -82,7 +82,7 @@ class PresenceService(gobject.GObject):
|
||||
for account_path, connection in connections_per_account.items():
|
||||
if not connection.connected:
|
||||
continue
|
||||
logging.debug("Calling GetActivity on %s", account_path)
|
||||
logging.debug('Calling GetActivity on %s', account_path)
|
||||
try:
|
||||
room_handle = connection.connection.GetActivity(
|
||||
activity_id,
|
||||
@@ -172,12 +172,12 @@ class PresenceService(gobject.GObject):
|
||||
def __share_activity_cb(self, activity):
|
||||
"""Finish sharing the activity
|
||||
"""
|
||||
self.emit("activity-shared", True, activity, None)
|
||||
self.emit('activity-shared', True, activity, None)
|
||||
|
||||
def __share_activity_error_cb(self, activity, error):
|
||||
"""Notify with GObject event of unsuccessful sharing of activity
|
||||
"""
|
||||
self.emit("activity-shared", False, activity, error)
|
||||
self.emit('activity-shared', False, activity, error)
|
||||
|
||||
def share_activity(self, activity, properties=None, private=True):
|
||||
if properties is None:
|
||||
|
||||
Reference in New Issue
Block a user