misc: fix unnamed arguments in format strings

This commit is contained in:
souliane 2014-02-17 14:58:26 +01:00
commit 24beb81688
5 changed files with 14 additions and 14 deletions

View file

@ -317,7 +317,7 @@ class Chat(urwid.WidgetWrap, QuickChat):
if self.type == "one2one":
self.host.x_notify.sendNotification(_("Primitivus: %s is talking to you") % from_jid)
elif self.getUserNick().lower() in msg.lower():
self.host.x_notify.sendNotification(_("Primitivus: %s mentioned you in room '%s'") % (from_jid, self.target))
self.host.x_notify.sendNotification(_("Primitivus: %(user)s mentioned you in room '%(room)s'") % {'user': from_jid, 'room': self.target})
def startGame(self, game_type, referee, players):
"""Configure the chat window to start a game"""

View file

@ -473,8 +473,8 @@ class Params(object):
return None
if not self.checkSecurityLimit(node[1], security_limit):
warning(_("Trying to get parameter '%s' in category '%s' without authorization!!!"
% (name, category)))
warning(_("Trying to get parameter '%(param)s' in category '%(cat)s' without authorization!!!"
% {'param': name, 'cat': category}))
return None
if node[0] == GENERAL:
@ -720,8 +720,8 @@ class Params(object):
return
if not self.checkSecurityLimit(node[1], security_limit):
warning(_("Trying to set parameter '%s' in category '%s' without authorization!!!"
% (name, category)))
warning(_("Trying to set parameter '%(param)s' in category '%(cat)s' without authorization!!!"
% {'param': name, 'cat': category}))
return
if node[0] == GENERAL:

View file

@ -193,7 +193,7 @@ class RoomGame(object):
break
if not auth and (verbose or _DEBUG):
debug(_("%s not allowed to join the game %s in %s") % (user_jid_s or nick, self.name, room_jid_s))
debug(_("%(user)s not allowed to join the game %(game)s in %(room)s") % {'user': user_jid_s or nick, 'game': self.name, 'room': room_jid_s})
return auth
def _updatePlayers(self, room_jid_s, nicks, sync, profile):
@ -327,7 +327,7 @@ class RoomGame(object):
elif self.invite_mode == self.FROM_PLAYERS:
auth = self.isPlayer(room_jid_s, nick)
if not auth and (verbose or _DEBUG):
debug(_("%s not allowed to invite for the game %s in %s") % (nick, self.name, room_jid_s))
debug(_("%(user)s not allowed to invite for the game %(game)s in %(room)s") % {'user': nick, 'game': self.name, 'room': room_jid_s})
return auth
def isReferee(self, room_jid_s, nick):
@ -372,7 +372,7 @@ class RoomGame(object):
(nicks, missing) = self.host.plugins["XEP-0045"].getRoomNicksOfUsers(room, other_players, secure=False)
result = (len(nicks) == len(other_players), nicks, missing)
if not result[0] and (verbose or _DEBUG):
debug(_("Still waiting for %s before starting the game %s in %s") % (result[2], self.name, room.occupantJID.userhost()))
debug(_("Still waiting for %(users)s before starting the game %(game)s in %(room)s") % {'users': result[2], 'game': self.name, 'room': room.occupantJID.userhost()})
return result
def getUniqueName(self, muc_service="", profile_key='@DEFAULT@'):
@ -499,10 +499,10 @@ class RoomGame(object):
if self._gameExists(room_jid_s):
is_referee = self.isReferee(room_jid_s, user_nick)
if self._gameExists(room_jid_s, started=True):
warning(_("%s game already created in room %s") % (self.name, room_jid_s))
warning(_("%(game)s game already created in room %(room)s") % {'game': self.name, 'room': room_jid_s})
return False, is_referee
elif not is_referee:
warning(_("%s game in room %s can only be created by %s") % (self.name, room_jid_s, user_nick))
warning(_("%(game)s game in room %(room)s can only be created by %(user)s") % {'game': self.name, 'room': room_jid_s, 'user': user_nick})
return False, False
else:
self._initGame(room_jid_s, user_nick)
@ -515,7 +515,7 @@ class RoomGame(object):
@param room_jid: JID userhost of the room
@param nicks: list of players nicks in the room (referee included, in first position)
@param profile_key: %(doc_profile_key)s"""
debug(_("Creating %s game in room %s") % (self.name, room_jid_s))
debug(_("Creating %(game)s game in room %(room)s") % {'game': self.name, 'room': room_jid_s})
profile = self.host.memory.getProfileName(profile_key)
if not profile:
error(_("profile %s is unknown") % profile_key)

View file

@ -87,7 +87,7 @@ class XEP_0033(object):
if entity is None:
return Failure(AbortSendMessage(_("XEP-0033 is being used but the server doesn't support it!")))
if mess_data["to"] != entity:
logging.warning(_("Stanzas using XEP-0033 should be addressed to %s, not %s!") % (entity, mess_data["to"]))
logging.warning(_("Stanzas using XEP-0033 should be addressed to %(expected)s, not %(current)s!") % {'expected': entity, 'current': mess_data["to"]})
logging.warning(_("TODO: addressing has be fixed by the backend... fix it in the frontend!"))
mess_data["to"] = entity
element = mess_data['xml'].addElement('addresses', NS_ADDRESS)

View file

@ -151,10 +151,10 @@ class XEP_0249(object):
if autojoin == "always":
self._accept(room, profile)
elif autojoin == "ask":
data = {"message": _("You have been invited by %s to join the room %s. Do you accept?") % (from_, room), "title": _("MUC invitation")}
data = {"message": _("You have been invited by %(user)s to join the room %(room)s. Do you accept?") % {'user': from_, 'room': room}, "title": _("MUC invitation")}
self.host.askConfirmation(room, "YES/NO", data, accept_cb, profile)
else:
self.host.bridge.newAlert(_("An invitation from %s to join the room %s has been declined according to your personal settings.") % (from_, room), _("MUC invitation"), "INFO", profile)
self.host.bridge.newAlert(_("An invitation from %(user)s to join the room %(room)s has been declined according to your personal settings.") % {'user': from_, 'room': room}, _("MUC invitation"), "INFO", profile)
class XEP_0249_handler(XMPPHandler):