comparison src/plugins/plugin_misc_radiocol.py @ 1409:3265a2639182

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:57 +0200
parents 069ad98b360d
children 8767c0bb7d48
comparison
equal deleted inserted replaced
1408:8a7145138330 1409:3265a2639182
134 which trigger after the song has been played to play next one""" 134 which trigger after the song has been played to play next one"""
135 # TODO: songs need to be erased once played or found invalids 135 # TODO: songs need to be erased once played or found invalids
136 # ==> unlink done the Q&D way with the same host trick (see above) 136 # ==> unlink done the Q&D way with the same host trick (see above)
137 radio_data = self.games[room_jid] 137 radio_data = self.games[room_jid]
138 if len(radio_data['players']) == 0: 138 if len(radio_data['players']) == 0:
139 log.debug(_('No more participants in the radiocol: cleaning data')) 139 log.debug(_(u'No more participants in the radiocol: cleaning data'))
140 radio_data['queue'] = [] 140 radio_data['queue'] = []
141 for filename in radio_data['to_delete']: 141 for filename in radio_data['to_delete']:
142 self.deleteFile(filename, radio_data) 142 self.deleteFile(filename, radio_data)
143 radio_data['to_delete'] = {} 143 radio_data['to_delete'] = {}
144 queue = radio_data['queue'] 144 queue = radio_data['queue']
170 """ 170 """
171 if radio_data: 171 if radio_data:
172 try: 172 try:
173 file_to_delete = radio_data['to_delete'][filename] 173 file_to_delete = radio_data['to_delete'][filename]
174 except KeyError: 174 except KeyError:
175 log.error(_("INTERNAL ERROR: can't find full path of the song to delete")) 175 log.error(_(u"INTERNAL ERROR: can't find full path of the song to delete"))
176 return False 176 return False
177 else: 177 else:
178 file_to_delete = filename 178 file_to_delete = filename
179 try: 179 try:
180 unlink(file_to_delete) 180 unlink(file_to_delete)
181 except OSError: 181 except OSError:
182 log.error(_("INTERNAL ERROR: can't find %s on the file system" % file_to_delete)) 182 log.error(_(u"INTERNAL ERROR: can't find %s on the file system" % file_to_delete))
183 return False 183 return False
184 return True 184 return True
185 185
186 def room_game_cmd(self, mess_elt, profile): 186 def room_game_cmd(self, mess_elt, profile):
187 from_jid = jid.JID(mess_elt['from']) 187 from_jid = jid.JID(mess_elt['from'])
240 if not radio_data['playing'] and len(queue) == QUEUE_TO_START: 240 if not radio_data['playing'] and len(queue) == QUEUE_TO_START:
241 # We have not started playing yet, and we have QUEUE_TO_START 241 # We have not started playing yet, and we have QUEUE_TO_START
242 # songs in queue. We can now start the party :) 242 # songs in queue. We can now start the party :)
243 self.playNext(room_jid, profile) 243 self.playNext(room_jid, profile)
244 else: 244 else:
245 log.error(_('Unmanaged game element: %s') % elt.name) 245 log.error(_(u'Unmanaged game element: %s') % elt.name)
246 246
247 def getSyncDataForPlayer(self, room_jid, nick): 247 def getSyncDataForPlayer(self, room_jid, nick):
248 game_data = self.games[room_jid] 248 game_data = self.games[room_jid]
249 elements = [] 249 elements = []
250 if game_data['playing']: 250 if game_data['playing']: