diff src/plugins/plugin_misc_room_game.py @ 844:f3513c8cc2e6

misc: fix unnamed arguments in format strings
author souliane <souliane@mailoo.org>
date Mon, 17 Feb 2014 14:58:26 +0100
parents 8f335c03eebb
children c5a8f602662b
line wrap: on
line diff
--- a/src/plugins/plugin_misc_room_game.py	Mon Feb 17 12:25:17 2014 +0100
+++ b/src/plugins/plugin_misc_room_game.py	Mon Feb 17 14:58:26 2014 +0100
@@ -193,7 +193,7 @@
                         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 @@
         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 @@
             (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 @@
         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 @@
         @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)