Replace the '%s' % var pattern with str(var).
This commit is contained in:
parent
e846825fc8
commit
7b3a116d76
5 changed files with 14 additions and 14 deletions
|
@ -43,7 +43,7 @@ class Connection(slixmpp.ClientXMPP):
|
|||
# many features will be handled differently
|
||||
# depending on this setting
|
||||
self.anon = False
|
||||
jid = '%s' % config.get('jid')
|
||||
jid = config.get('jid')
|
||||
password = config.get('password')
|
||||
eval_password = config.get('eval_password')
|
||||
if not password and not eval_password and not (keyfile
|
||||
|
|
|
@ -895,7 +895,7 @@ class CommandCore:
|
|||
|
||||
def iqfunc(iq):
|
||||
"handler for an iq reply"
|
||||
self.core.information('%s' % iq, 'Iq')
|
||||
self.core.information(str(iq), 'Iq')
|
||||
self.core.xmpp.remove_handler('Iq %s' % iq_id)
|
||||
|
||||
self.core.xmpp.register_handler(
|
||||
|
|
|
@ -810,7 +810,7 @@ class Core(object):
|
|||
'Could not execute command (%s)',
|
||||
repr(command),
|
||||
exc_info=True)
|
||||
self.information('%s' % exc, 'Error')
|
||||
self.information(str(exc), 'Error')
|
||||
|
||||
def do_command(self, key, raw):
|
||||
"""
|
||||
|
@ -1179,7 +1179,7 @@ class Core(object):
|
|||
|
||||
def go_to_previous_tab(self):
|
||||
"Go to the previous tab"
|
||||
self.command.win('%s' % (self.previous_tab_nb, ))
|
||||
self.command.win(str(self.previous_tab_nb))
|
||||
|
||||
def go_to_important_room(self):
|
||||
"""
|
||||
|
@ -1207,7 +1207,7 @@ class Core(object):
|
|||
if (tab.nb < self.current_tab_nb
|
||||
and tab_refs[state][-1].nb > self.current_tab_nb):
|
||||
continue
|
||||
self.command.win('%s' % tab.nb)
|
||||
self.command.win(str(tab.nb))
|
||||
return
|
||||
return
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ class Core(object):
|
|||
for tab in self.tabs:
|
||||
if tab.name == tab_name:
|
||||
if (type_ and (isinstance(tab, type_))) or not type_:
|
||||
self.command.win('%s' % (tab.nb, ))
|
||||
self.command.win(str(tab.nb))
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ class Core(object):
|
|||
# if the room exists, focus it and return
|
||||
for tab in self.get_tabs(tabs.PrivateTab):
|
||||
if tab.name == complete_jid:
|
||||
self.command.win('%s' % tab.nb)
|
||||
self.command.win(str(tab.nb))
|
||||
return tab
|
||||
# create the new tab
|
||||
tab = self.get_tab_by_name(room_name, tabs.MucTab)
|
||||
|
|
|
@ -1404,7 +1404,7 @@ class HandlerCore:
|
|||
"""
|
||||
When a data form is received
|
||||
"""
|
||||
self.core.information('%s' % message)
|
||||
self.core.information(str(message))
|
||||
|
||||
def on_attention(self, message):
|
||||
"""
|
||||
|
@ -1430,11 +1430,11 @@ class HandlerCore:
|
|||
"""
|
||||
if self.core.xml_tab:
|
||||
if PYGMENTS:
|
||||
xhtml_text = highlight('%s' % stanza, LEXER, FORMATTER)
|
||||
xhtml_text = highlight(str(stanza), LEXER, FORMATTER)
|
||||
poezio_colored = xhtml.xhtml_to_poezio_colors(
|
||||
xhtml_text, force=True).rstrip('\x19o').strip()
|
||||
else:
|
||||
poezio_colored = '%s' % stanza
|
||||
poezio_colored = str(stanza)
|
||||
self.core.add_message_to_text_buffer(
|
||||
self.core.xml_buffer,
|
||||
poezio_colored,
|
||||
|
@ -1459,11 +1459,11 @@ class HandlerCore:
|
|||
"""
|
||||
if self.core.xml_tab:
|
||||
if PYGMENTS:
|
||||
xhtml_text = highlight('%s' % stanza, LEXER, FORMATTER)
|
||||
xhtml_text = highlight(str(stanza), LEXER, FORMATTER)
|
||||
poezio_colored = xhtml.xhtml_to_poezio_colors(
|
||||
xhtml_text, force=True).rstrip('\x19o').strip()
|
||||
else:
|
||||
poezio_colored = '%s' % stanza
|
||||
poezio_colored = str(stanza)
|
||||
self.core.add_message_to_text_buffer(
|
||||
self.core.xml_buffer,
|
||||
poezio_colored,
|
||||
|
|
|
@ -274,11 +274,11 @@ class RosterWin(Win):
|
|||
contact.subscription, keep=show_roster_sub))
|
||||
|
||||
if not show_roster_jids and contact.name:
|
||||
display_name = '%s' % contact.name
|
||||
display_name = contact.name
|
||||
elif contact.name and contact.name != contact.bare_jid:
|
||||
display_name = '%s (%s)' % (contact.name, contact.bare_jid)
|
||||
else:
|
||||
display_name = '%s' % (contact.bare_jid, )
|
||||
display_name = contact.bare_jid
|
||||
|
||||
display_name = self.truncate_name(display_name, added) + nb
|
||||
|
||||
|
|
Loading…
Reference in a new issue