Use proper formatting syntax, fixes #2170

This commit is contained in:
akskumarnot 2013-12-25 14:44:10 +05:30 committed by Daniel Narvaez
parent f43d5f8d24
commit 81b388c554
10 changed files with 81 additions and 80 deletions

View File

@ -404,12 +404,12 @@ class Activity(Window, Gtk.Container):
def _set_up_sharing(self, mesh_instance, share_scope): def _set_up_sharing(self, mesh_instance, share_scope):
# handle activity share/join # handle activity share/join
logging.debug('*** Act %s, mesh instance %r, scope %s', logging.debug('*** Act %s, mesh instance %r, scope %s' %
self._activity_id, mesh_instance, share_scope) (self._activity_id, mesh_instance, share_scope))
if mesh_instance is not None: if mesh_instance is not None:
# There's already an instance on the mesh, join it # There's already an instance on the mesh, join it
logging.debug('*** Act %s joining existing mesh instance %r', logging.debug('*** Act %s joining existing mesh instance %r' %
self._activity_id, mesh_instance) (self._activity_id, mesh_instance))
self.shared_activity = mesh_instance self.shared_activity = mesh_instance
self.shared_activity.connect('notify::private', self.shared_activity.connect('notify::private',
self.__privacy_changed_cb) self.__privacy_changed_cb)
@ -421,7 +421,7 @@ class Activity(Window, Gtk.Container):
self.__joined_cb(self.shared_activity, True, None) self.__joined_cb(self.shared_activity, True, None)
elif share_scope != SCOPE_PRIVATE: elif share_scope != SCOPE_PRIVATE:
logging.debug('*** Act %s no existing mesh instance, but used to ' logging.debug('*** Act %s no existing mesh instance, but used to '
'be shared, will share', self._activity_id) 'be shared, will share' % self._activity_id)
# no existing mesh instance, but activity used to be shared, so # no existing mesh instance, but activity used to be shared, so
# restart the share # restart the share
if share_scope == SCOPE_INVITE_ONLY: if share_scope == SCOPE_INVITE_ONLY:
@ -429,7 +429,7 @@ class Activity(Window, Gtk.Container):
elif share_scope == SCOPE_NEIGHBORHOOD: elif share_scope == SCOPE_NEIGHBORHOOD:
self.share(private=False) self.share(private=False)
else: else:
logging.debug('Unknown share scope %r', share_scope) logging.debug('Unknown share scope %r' % share_scope)
def __got_channel_cb(self, wait_loop, connection_path, channel_path, def __got_channel_cb(self, wait_loop, connection_path, channel_path,
handle_type): handle_type):
@ -544,7 +544,7 @@ class Activity(Window, Gtk.Container):
pass pass
def __jobject_error_cb(self, err): def __jobject_error_cb(self, err):
logging.debug('Error creating activity datastore object: %s', err) logging.debug('Error creating activity datastore object: %s' % err)
def get_activity_root(self): def get_activity_root(self):
""" FIXME: Deprecated. This part of the API has been moved """ FIXME: Deprecated. This part of the API has been moved
@ -622,13 +622,13 @@ class Activity(Window, Gtk.Container):
if self._closing: if self._closing:
self._show_keep_failed_dialog() self._show_keep_failed_dialog()
self._closing = False self._closing = False
raise RuntimeError('Error saving activity object to datastore: %s', raise RuntimeError('Error saving activity object to datastore: %s' %
err) err)
def _cleanup_jobject(self): def _cleanup_jobject(self):
if self._jobject: if self._jobject:
if self._owns_file and os.path.isfile(self._jobject.file_path): if self._owns_file and os.path.isfile(self._jobject.file_path):
logging.debug('_cleanup_jobject: removing %r', logging.debug('_cleanup_jobject: removing %r' %
self._jobject.file_path) self._jobject.file_path)
os.remove(self._jobject.file_path) os.remove(self._jobject.file_path)
self._owns_file = False self._owns_file = False
@ -715,7 +715,7 @@ class Activity(Window, Gtk.Container):
logging.debug('Cannot save, no journal object.') logging.debug('Cannot save, no journal object.')
return return
logging.debug('Activity.save: %r', self._jobject.object_id) logging.debug('Activity.save: %r' % self._jobject.object_id)
if self._updating_jobject: if self._updating_jobject:
logging.info('Activity.save: still processing a previous request.') logging.info('Activity.save: still processing a previous request.')
@ -762,12 +762,13 @@ class Activity(Window, Gtk.Container):
Activities should not override this method. Instead, like save() do any Activities should not override this method. Instead, like save() do any
copy work that needs to be done in write_file() copy work that needs to be done in write_file()
""" """
logging.debug('Activity.copy: %r', self._jobject.object_id) logging.debug('Activity.copy: %r' % self._jobject.object_id)
self.save() self.save()
self._jobject.object_id = None self._jobject.object_id = None
def __privacy_changed_cb(self, shared_activity, param_spec): def __privacy_changed_cb(self, shared_activity, param_spec):
logging.debug('__privacy_changed_cb %r', shared_activity.props.private) logging.debug('__privacy_changed_cb %r' %
shared_activity.props.private)
if shared_activity.props.private: if shared_activity.props.private:
self._jobject.metadata['share-scope'] = SCOPE_INVITE_ONLY self._jobject.metadata['share-scope'] = SCOPE_INVITE_ONLY
else: else:
@ -775,11 +776,11 @@ class Activity(Window, Gtk.Container):
def __joined_cb(self, activity, success, err): def __joined_cb(self, activity, success, err):
"""Callback when join has finished""" """Callback when join has finished"""
logging.debug('Activity.__joined_cb %r', success) logging.debug('Activity.__joined_cb %r' % success)
self.shared_activity.disconnect(self._join_id) self.shared_activity.disconnect(self._join_id)
self._join_id = None self._join_id = None
if not success: if not success:
logging.debug('Failed to join activity: %s', err) logging.debug('Failed to join activity: %s' % err)
return return
self.reveal() self.reveal()
@ -801,12 +802,12 @@ class Activity(Window, Gtk.Container):
def __share_cb(self, ps, success, activity, err): def __share_cb(self, ps, success, activity, err):
if not success: if not success:
logging.debug('Share of activity %s failed: %s.', logging.debug('Share of activity %s failed: %s.' %
self._activity_id, err) (self._activity_id, err))
return return
logging.debug('Share of activity %s successful, PS activity is %r.', logging.debug('Share of activity %s successful, PS activity is %r.' %
self._activity_id, activity) (self._activity_id, activity))
activity.props.name = self._jobject.metadata['title'] activity.props.name = self._jobject.metadata['title']
@ -862,8 +863,8 @@ class Activity(Window, Gtk.Container):
raise RuntimeError('Activity %s already shared.' % raise RuntimeError('Activity %s already shared.' %
self._activity_id) self._activity_id)
verb = private and 'private' or 'public' verb = private and 'private' or 'public'
logging.debug('Requesting %s share of activity %s.', verb, logging.debug('Requesting %s share of activity %s.' % (verb,
self._activity_id) self._activity_id))
pservice = presenceservice.get_instance() pservice = presenceservice.get_instance()
pservice.connect('activity-shared', self.__share_cb) pservice.connect('activity-shared', self.__share_cb)
pservice.share_activity(self, private=private) pservice.share_activity(self, private=private)
@ -1009,17 +1010,17 @@ class _ClientHandler(dbus.service.Object, DBusProperties):
CHANNEL + '.TargetHandleType': CONNECTION_HANDLE_TYPE_CONTACT, CHANNEL + '.TargetHandleType': CONNECTION_HANDLE_TYPE_CONTACT,
} }
filter_dict = dbus.Dictionary(filters, signature='sv') filter_dict = dbus.Dictionary(filters, signature='sv')
logging.debug('__get_filters_cb %r', dbus.Array([filter_dict], logging.debug('__get_filters_cb %r' % dbus.Array([filter_dict],
signature='a{sv}')) signature='a{sv}'))
return dbus.Array([filter_dict], signature='a{sv}') return dbus.Array([filter_dict], signature='a{sv}')
@dbus.service.method(dbus_interface=CLIENT_HANDLER, @dbus.service.method(dbus_interface=CLIENT_HANDLER,
in_signature='ooa(oa{sv})aota{sv}', out_signature='') in_signature='ooa(oa{sv})aota{sv}', out_signature='')
def HandleChannels(self, account, connection, channels, requests_satisfied, def HandleChannels(self, account, connection, channels, requests_satisfied,
user_action_time, handler_info): user_action_time, handler_info):
logging.debug('HandleChannels\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r', logging.debug('HandleChannels\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r\n\t%r' %
account, connection, channels, requests_satisfied, (account, connection, channels, requests_satisfied,
user_action_time, handler_info) user_action_time, handler_info))
try: try:
for object_path, properties in channels: for object_path, properties in channels:
channel_type = properties[CHANNEL + '.ChannelType'] channel_type = properties[CHANNEL + '.ChannelType']

View File

@ -124,7 +124,7 @@ def get_command(activity, activity_id=None, object_id=None, uri=None,
if os.path.exists(absolute_path): if os.path.exists(absolute_path):
command[0] = absolute_path command[0] = absolute_path
logging.debug('launching: %r', command) logging.debug('launching: %r' % command)
return command return command
@ -265,25 +265,25 @@ class ActivityCreationHandler(GObject.GObject):
pass pass
def _notify_launch_failure_error_handler(self, err): def _notify_launch_failure_error_handler(self, err):
logging.error('Notify launch failure failed %s', err) logging.error('Notify launch failure failed %s' % err)
def _notify_launch_error_handler(self, err): def _notify_launch_error_handler(self, err):
logging.debug('Notify launch failed %s', err) logging.debug('Notify launch failed %s' % err)
def _activate_reply_handler(self, activated): def _activate_reply_handler(self, activated):
if not activated: if not activated:
self._create_activity() self._create_activity()
def _activate_error_handler(self, err): def _activate_error_handler(self, err):
logging.error('Activity activation request failed %s', err) logging.error('Activity activation request failed %s' % err)
def _create_reply_handler(self): def _create_reply_handler(self):
logging.debug('Activity created %s (%s).', logging.debug('Activity created %s (%s).' %
self._handle.activity_id, self._service_name) (self._handle.activity_id, self._service_name))
def _create_error_handler(self, err): def _create_error_handler(self, err):
logging.error("Couldn't create activity %s (%s): %s", logging.error("Couldn't create activity %s (%s): %s" %
self._handle.activity_id, self._service_name, err) (self._handle.activity_id, self._service_name, err))
self._shell.NotifyLaunchFailure( self._shell.NotifyLaunchFailure(
self._handle.activity_id, reply_handler=self._no_reply_handler, self._handle.activity_id, reply_handler=self._no_reply_handler,
error_handler=self._notify_launch_failure_error_handler) error_handler=self._notify_launch_failure_error_handler)
@ -296,7 +296,7 @@ class ActivityCreationHandler(GObject.GObject):
self._launch_activity() self._launch_activity()
def _find_object_error_handler(self, err): def _find_object_error_handler(self, err):
logging.error('Datastore find failed %s', err) logging.error('Datastore find failed %s' % err)
self._launch_activity() self._launch_activity()

View File

@ -348,8 +348,8 @@ class ActivityBundle(Bundle):
return return
if not os.path.islink(dst) and os.path.exists(dst): if not os.path.islink(dst) and os.path.exists(dst):
raise RuntimeError('Do not remove %s if it was not ' raise RuntimeError('Do not remove %s if it was not '
'installed by sugar', dst) 'installed by sugar' % dst)
logging.debug('Link resource %s to %s', src, dst) logging.debug('Link resource %s to %s' % (src, dst))
if os.path.lexists(dst): if os.path.lexists(dst):
logging.debug('Relink %s', dst) logging.debug('Relink %s', dst)
os.unlink(dst) os.unlink(dst)

View File

@ -124,7 +124,7 @@ class Bundle(object):
data = self._zip_file.read(path) data = self._zip_file.read(path)
f = StringIO.StringIO(data) f = StringIO.StringIO(data)
except KeyError: except KeyError:
logging.debug('%s not found.', filename) logging.debug('%s not found.' % filename)
return f return f

View File

@ -228,7 +228,7 @@ class ObjectChooser(object):
def __chooser_response_cb(self, chooser_id, object_id): def __chooser_response_cb(self, chooser_id, object_id):
if chooser_id != self._chooser_id: if chooser_id != self._chooser_id:
return return
logging.debug('ObjectChooser.__chooser_response_cb: %r', object_id) logging.debug('ObjectChooser.__chooser_response_cb: %r' % object_id)
self._response_code = Gtk.ResponseType.ACCEPT self._response_code = Gtk.ResponseType.ACCEPT
self._object_id = object_id self._object_id = object_id
self._cleanup() self._cleanup()
@ -236,7 +236,7 @@ class ObjectChooser(object):
def __chooser_cancelled_cb(self, chooser_id): def __chooser_cancelled_cb(self, chooser_id):
if chooser_id != self._chooser_id: if chooser_id != self._chooser_id:
return return
logging.debug('ObjectChooser.__chooser_cancelled_cb: %r', chooser_id) logging.debug('ObjectChooser.__chooser_cancelled_cb: %r' % chooser_id)
self._response_code = Gtk.ResponseType.CANCEL self._response_code = Gtk.ResponseType.CANCEL
self._cleanup() self._cleanup()

View File

@ -61,7 +61,7 @@ def set_level(level):
try: try:
logging.getLogger('').setLevel(int(level)) logging.getLogger('').setLevel(int(level))
except ValueError: except ValueError:
logging.warning('Invalid log level: %r', level) logging.warning('Invalid log level: %r' % level)
# pylint: disable-msg=E1101,F0401 # pylint: disable-msg=E1101,F0401
@ -235,7 +235,7 @@ def trace(logger=None, logger_name=None, skip_args=None, skip_kwargs=None,
try: try:
res = f(*args, **kwargs) res = f(*args, **kwargs)
except: except:
trace_logger.exception("Exception occured in %s", f.__name__) trace_logger.exception("Exception occured in %s" % f.__name__)
raise raise
trace_logger.log(TRACE, "%s(%s) returned %s", f.__name__, trace_logger.log(TRACE, "%s(%s) returned %s", f.__name__,

View File

@ -138,17 +138,17 @@ class Activity(GObject.GObject):
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,
properties) properties))
self._update_properties(properties) self._update_properties(properties)
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)
self._get_properties_call = None self._get_properties_call = None
self._update_properties(properties) self._update_properties(properties)
def __error_handler_cb(self, error): def __error_handler_cb(self, error):
_logger.debug('__error_handler_cb %r', error) _logger.debug('__error_handler_cb %r' % error)
def _update_properties(self, new_props): def _update_properties(self, new_props):
val = new_props.get('name', self._name) val = new_props.get('name', self._name)
@ -188,7 +188,7 @@ class Activity(GObject.GObject):
if self._get_properties_call is not None: if self._get_properties_call is not None:
_logger.debug('%r: Blocking on GetProperties() because someone ' _logger.debug('%r: Blocking on GetProperties() because someone '
'wants property %s', self, pspec.name) 'wants property %s' % (self, pspec.name))
self._get_properties_call.block() self._get_properties_call.block()
if pspec.name == 'id': if pspec.name == 'id':
@ -218,12 +218,12 @@ class Activity(GObject.GObject):
elif pspec.name == 'private': elif pspec.name == 'private':
self._private = val self._private = val
else: else:
raise ValueError('Unknown property %r', pspec.name) raise ValueError('Unknown property %r' % pspec.name)
self._publish_properties() self._publish_properties()
def set_private(self, val, reply_handler, error_handler): def set_private(self, val, reply_handler, error_handler):
_logger.debug('set_private %r', val) _logger.debug('set_private %r' % val)
self._activity.SetProperties({'private': bool(val)}, self._activity.SetProperties({'private': bool(val)},
reply_handler=reply_handler, reply_handler=reply_handler,
error_handler=error_handler) error_handler=error_handler)
@ -271,7 +271,7 @@ class Activity(GObject.GObject):
raise NotImplementedError() raise NotImplementedError()
def __joined_cb(self, join_command, error): def __joined_cb(self, join_command, error):
_logger.debug('%r: Join finished %r', self, error) _logger.debug('%r: Join finished %r' % (self, error))
if error is not None: if error is not None:
self.emit('joined', error is None, str(error)) self.emit('joined', error is None, str(error))
self.telepathy_text_chan = join_command.text_channel self.telepathy_text_chan = join_command.text_channel
@ -295,8 +295,8 @@ class Activity(GObject.GObject):
channel.connect_to_signal('Closed', self.__text_channel_closed_cb) channel.connect_to_signal('Closed', self.__text_channel_closed_cb)
def __get_all_members_cb(self, members, local_pending, remote_pending): def __get_all_members_cb(self, members, local_pending, remote_pending):
_logger.debug('__get_all_members_cb %r %r', members, _logger.debug('__get_all_members_cb %r %r' % (members,
self._text_channel_group_flags) self._text_channel_group_flags))
if self._channel_self_handle in members: if self._channel_self_handle in members:
members.remove(self._channel_self_handle) members.remove(self._channel_self_handle)
@ -324,7 +324,7 @@ class Activity(GObject.GObject):
get_handle_owners_cb(input_handles) get_handle_owners_cb(input_handles)
def _add_initial_buddies(self, contact_ids): def _add_initial_buddies(self, contact_ids):
_logger.debug('__add_initial_buddies %r', contact_ids) _logger.debug('__add_initial_buddies %r' % contact_ids)
for contact_id in contact_ids: for contact_id in contact_ids:
self._buddies[contact_id] = self._get_buddy(contact_id) self._buddies[contact_id] = self._get_buddy(contact_id)
self._joined_buddies[contact_id] = self._get_buddy(contact_id) self._joined_buddies[contact_id] = self._get_buddy(contact_id)
@ -335,7 +335,7 @@ class Activity(GObject.GObject):
def __text_channel_members_changed_cb(self, message, added, removed, def __text_channel_members_changed_cb(self, message, added, removed,
local_pending, remote_pending, local_pending, remote_pending,
actor, reason): actor, reason):
_logger.debug('__text_channel_members_changed_cb %r', _logger.debug('__text_channel_members_changed_cb %r' %
[added, message, added, removed, local_pending, [added, message, added, removed, local_pending,
remote_pending, actor, reason]) remote_pending, actor, reason])
if self._channel_self_handle in added: if self._channel_self_handle in added:
@ -382,7 +382,7 @@ class Activity(GObject.GObject):
self.emit('joined', True, None) self.emit('joined', True, None)
return return
_logger.debug('%r: joining', self) _logger.debug('%r: joining' % self)
self._join_command = _JoinCommand(self.telepathy_conn, self._join_command = _JoinCommand(self.telepathy_conn,
self.room_handle) self.room_handle)
@ -402,7 +402,7 @@ class Activity(GObject.GObject):
def __shared_cb(self, share_activity_cb, share_activity_error_cb, def __shared_cb(self, share_activity_cb, share_activity_error_cb,
share_command, error): share_command, error):
_logger.debug('%r: Share finished %r', self, error) _logger.debug('%r: Share finished %r' % (self, error))
if error is None: if error is None:
self._joined = True self._joined = True
self.room_handle = share_command.room_handle self.room_handle = share_command.room_handle
@ -438,7 +438,7 @@ class Activity(GObject.GObject):
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))
share_activity_error_cb(self, error) share_activity_error_cb(self, error)
# GetChannels() wrapper # GetChannels() wrapper
@ -459,8 +459,8 @@ class Activity(GObject.GObject):
channels = [self.telepathy_text_chan.object_path, channels = [self.telepathy_text_chan.object_path,
self.telepathy_tubes_chan.object_path] self.telepathy_tubes_chan.object_path]
_logger.debug('%r: bus name is %s, connection is %s, channels are %r', _logger.debug('%r: bus name is %s, connection is %s, channels are %r' %
self, bus_name, connection_path, channels) (self, bus_name, connection_path, channels))
return bus_name, connection_path, channels return bus_name, connection_path, channels
# Leaving # Leaving
@ -470,7 +470,7 @@ class Activity(GObject.GObject):
def leave(self): def leave(self):
"""Leave this shared activity""" """Leave this shared activity"""
_logger.debug('%r: leaving', self) _logger.debug('%r: leaving' % self)
self.telepathy_text_chan.Close() self.telepathy_text_chan.Close()
@ -511,7 +511,7 @@ class _ShareCommand(_BaseCommand):
dbus_interface=CONNECTION) dbus_interface=CONNECTION)
def __got_handles_cb(self, handles): def __got_handles_cb(self, handles):
logging.debug('__got_handles_cb %r', handles) logging.debug('__got_handles_cb %r' % handles)
self.room_handle = handles[0] self.room_handle = handles[0]
self._join_command = _JoinCommand(self._connection, self.room_handle) self._join_command = _JoinCommand(self._connection, self.room_handle)
@ -519,7 +519,7 @@ class _ShareCommand(_BaseCommand):
self._join_command.run() self._join_command.run()
def __joined_cb(self, join_command, error): def __joined_cb(self, join_command, error):
_logger.debug('%r: Join finished %r', self, error) _logger.debug('%r: Join finished %r' % (self, error))
if error is not None: if error is not None:
self._finished = True self._finished = True
self.emit('finished', error) self.emit('finished', error)
@ -597,12 +597,12 @@ class _JoinCommand(_BaseCommand):
self.emit('finished', error) self.emit('finished', error)
def __tubes_channel_ready_cb(self, channel): def __tubes_channel_ready_cb(self, channel):
_logger.debug('%r: Tubes channel %r is ready', self, channel) _logger.debug('%r: Tubes channel %r is ready' % (self, channel))
self.tubes_channel = channel self.tubes_channel = channel
self._tubes_ready() self._tubes_ready()
def __text_channel_ready_cb(self, channel): def __text_channel_ready_cb(self, channel):
_logger.debug('%r: Text channel %r is ready', self, channel) _logger.debug('%r: Text channel %r is ready' % (self, channel))
self.text_channel = channel self.text_channel = channel
self._tubes_ready() self._tubes_ready()
@ -611,13 +611,13 @@ class _JoinCommand(_BaseCommand):
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)
self._add_self_to_channel() self._add_self_to_channel()
def __text_channel_group_flags_changed_cb(self, added, removed): def __text_channel_group_flags_changed_cb(self, added, removed):
_logger.debug('__text_channel_group_flags_changed_cb %r %r', added, _logger.debug('__text_channel_group_flags_changed_cb %r %r' % (added,
removed) removed))
self.text_channel_group_flags |= added self.text_channel_group_flags |= added
self.text_channel_group_flags &= ~removed self.text_channel_group_flags &= ~removed
@ -629,8 +629,8 @@ class _JoinCommand(_BaseCommand):
def got_all_members(members, local_pending, remote_pending): def got_all_members(members, local_pending, remote_pending):
_logger.debug('got_all_members members %r local_pending %r ' _logger.debug('got_all_members members %r local_pending %r '
'remote_pending %r', members, local_pending, 'remote_pending %r' % (members, local_pending,
remote_pending) remote_pending))
if self.text_channel_group_flags & \ if self.text_channel_group_flags & \
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES: CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES:
@ -639,7 +639,7 @@ class _JoinCommand(_BaseCommand):
self_handle = self._global_self_handle self_handle = self._global_self_handle
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( error_handler=lambda e: self._join_failed_cb(
@ -675,8 +675,8 @@ class _JoinCommand(_BaseCommand):
actor, reason): actor, reason):
_logger.debug('__text_channel_members_changed_cb added %r removed %r ' _logger.debug('__text_channel_members_changed_cb added %r removed %r '
'local_pending %r remote_pending %r channel_self_handle ' 'local_pending %r remote_pending %r channel_self_handle '
'%r', added, removed, local_pending, remote_pending, '%r' % (added, removed, local_pending, remote_pending,
self.channel_self_handle) self.channel_self_handle))
if self.text_channel_group_flags & \ if self.text_channel_group_flags & \
CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES: CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES:

View File

@ -81,7 +81,7 @@ class PresenceService(GObject.GObject):
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,
@ -90,7 +90,7 @@ class PresenceService(GObject.GObject):
name = 'org.freedesktop.Telepathy.Error.NotAvailable' name = 'org.freedesktop.Telepathy.Error.NotAvailable'
if e.get_dbus_name() == name: if e.get_dbus_name() == name:
logging.debug("There's no shared activity with the id " logging.debug("There's no shared activity with the id "
"%s", activity_id) "%s" % activity_id)
else: else:
raise raise
else: else:
@ -162,8 +162,8 @@ class PresenceService(GObject.GObject):
dbus_interface=CONNECTION) 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' %
tp_conn_path, handle) (tp_conn_path, handle))
def get_owner(self): def get_owner(self):
"""Retrieves the laptop Buddy object.""" """Retrieves the laptop Buddy object."""
@ -198,7 +198,7 @@ class PresenceService(GObject.GObject):
properties['private'] = private properties['private'] = private
if self._activity_cache is not None: if self._activity_cache is not None:
raise ValueError('Activity %s is already tracked', raise ValueError('Activity %s is already tracked' %
activity.get_id()) activity.get_id())
connection_manager = get_connection_manager() connection_manager = get_connection_manager()

View File

@ -47,7 +47,7 @@ def _retry_find(func):
if e.code == Atspi.Error.IPC: if e.code == Atspi.Error.IPC:
continue continue
logging.error("GError code %d", e.code) logging.error("GError code %d" % e.code)
raise raise
expect_none = kwargs.get("expect_none", False) expect_none = kwargs.get("expect_none", False)

View File

@ -307,7 +307,7 @@ class TempFilePath(str):
if path is None: if path is None:
fd, path = tempfile.mkstemp() fd, path = tempfile.mkstemp()
os.close(fd) os.close(fd)
logging.debug('TempFilePath created %r', path) logging.debug('TempFilePath created %r' % path)
if path in _tracked_paths: if path in _tracked_paths:
_tracked_paths[path] += 1 _tracked_paths[path] += 1
@ -322,9 +322,9 @@ class TempFilePath(str):
if os.path.exists(self): if os.path.exists(self):
os.unlink(self) os.unlink(self)
logging.debug('TempFilePath deleted %r', self) logging.debug('TempFilePath deleted %r' % self)
else: else:
logging.warning('TempFilePath already deleted %r', self) logging.warning('TempFilePath already deleted %r' % self)
else: else:
_tracked_paths[self] -= 1 _tracked_paths[self] -= 1