comparison frontends/primitivus/chat.py @ 202:754e12eaea14

primitivus: fixed unicode issue on date in chat window
author Goffi <goffi@goffi.org>
date Fri, 20 Aug 2010 01:14:47 +0800
parents 31632472e857
children 3198bfd66daa
comparison
equal deleted inserted replaced
201:9e7bc7f09221 202:754e12eaea14
61 61
62 def display_widget(self, size, focus): 62 def display_widget(self, size, focus):
63 render_txt = [] 63 render_txt = []
64 if self.parent.show_timestamp: 64 if self.parent.show_timestamp:
65 time_format = "%c" if self.timestamp < self.parent.day_change else "%H:%M" #if the message was sent before today, we print the full date 65 time_format = "%c" if self.timestamp < self.parent.day_change else "%H:%M" #if the message was sent before today, we print the full date
66 render_txt.append(('date',"[%s]" % time.strftime(time_format, self.timestamp))) 66 render_txt.append(('date',"[%s]" % time.strftime(time_format, self.timestamp).decode('utf-8')))
67 if self.parent.show_short_nick: 67 if self.parent.show_short_nick:
68 render_txt.append(('my_nick' if self.my_mess else 'other_nick',"**" if self.my_mess else "*")) 68 render_txt.append(('my_nick' if self.my_mess else 'other_nick',"**" if self.my_mess else "*"))
69 else: 69 else:
70 render_txt.append(('my_nick' if self.my_mess else 'other_nick',"[%s] " % self.nick)) 70 render_txt.append(('my_nick' if self.my_mess else 'other_nick',"[%s] " % self.nick))
71 render_txt.append(self.message) 71 render_txt.append(self.message)