comparison src/server/blog.py @ 694:82123705474b

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:02 +0200
parents 9877607c719a
children d94feb0d849e
comparison
equal deleted inserted replaced
693:1d60fa4d25a4 694:82123705474b
68 @param dummy (str): that would be C.SERVICE_PROFILE 68 @param dummy (str): that would be C.SERVICE_PROFILE
69 """ 69 """
70 if key != 'avatar': 70 if key != 'avatar':
71 return 71 return
72 entity_jid_s = entity_jid_s.lower() 72 entity_jid_s = entity_jid_s.lower()
73 log.debug(_("Received a new avatar for entity %s") % entity_jid_s) 73 log.debug(_(u"Received a new avatar for entity %s") % entity_jid_s)
74 avatar = C.AVATARS_DIR + value 74 avatar = C.AVATARS_DIR + value
75 self.avatars_cache[entity_jid_s] = avatar 75 self.avatars_cache[entity_jid_s] = avatar
76 try: 76 try:
77 self.waiting_deferreds[entity_jid_s][1].callback(avatar) 77 self.waiting_deferreds[entity_jid_s][1].callback(avatar)
78 del self.waiting_deferreds[entity_jid_s] 78 del self.waiting_deferreds[entity_jid_s]
93 return 93 return
94 try: 94 try:
95 entity_jid_s = [key for (key, value) in self.waiting_deferreds.items() if value[0] == action_id][0] 95 entity_jid_s = [key for (key, value) in self.waiting_deferreds.items() if value[0] == action_id][0]
96 except IndexError: # impossible to guess the entity 96 except IndexError: # impossible to guess the entity
97 return 97 return
98 log.debug(_("Using default avatar for entity %s") % entity_jid_s) 98 log.debug(_(u"Using default avatar for entity %s") % entity_jid_s)
99 self.avatars_cache[entity_jid_s] = C.DEFAULT_AVATAR_URL 99 self.avatars_cache[entity_jid_s] = C.DEFAULT_AVATAR_URL
100 self.waiting_deferreds[entity_jid_s][1].callback(C.DEFAULT_AVATAR_URL) 100 self.waiting_deferreds[entity_jid_s][1].callback(C.DEFAULT_AVATAR_URL)
101 del self.waiting_deferreds[entity_jid_s] 101 del self.waiting_deferreds[entity_jid_s]
102 102
103 def getAvatar(self, profile): 103 def getAvatar(self, profile):