new colors

parent 724c4577
...@@ -359,7 +359,10 @@ class Gui(object): ...@@ -359,7 +359,10 @@ class Gui(object):
body = stanza.getBody() body = stanza.getBody()
subject = stanza.getSubject() subject = stanza.getSubject()
if subject: if subject:
info = room.add_info(_("%(nick)s changed the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}) if nick_from:
info = room.add_info(_("%(nick)s changed the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject})
else:
info = room.add_info(_("The subject is: %(subject)s") % {'subject':subject})
self.window.text_win.add_line(room, (datetime.now(), info)) self.window.text_win.add_line(room, (datetime.now(), info))
room.topic = subject.encode('utf-8').replace('\n', '|') room.topic = subject.encode('utf-8').replace('\n', '|')
if room == self.current_room(): if room == self.current_room():
......
...@@ -179,9 +179,17 @@ class TextWin(object): ...@@ -179,9 +179,17 @@ class TextWin(object):
return return
win = self.wins[room.name].win win = self.wins[room.name].win
users = room.users users = room.users
win.addstr('\n['+line[0].strftime("%H"))
win.attron(curses.color_pair(9))
win.addstr(':')
win.attroff(curses.color_pair(9))
win.addstr(line[0].strftime('%M'))
win.attron(curses.color_pair(9))
win.addstr(':')
win.attroff(curses.color_pair(9))
win.addstr(line[0].strftime('%S') + "] ")
if len(line) == 2: if len(line) == 2:
try: try:
win.addstr('\n['+line[0].strftime("%H:%M:%S") + "] ")
win.attron(curses.color_pair(8)) win.attron(curses.color_pair(8))
win.addstr(line[1]) win.addstr(line[1])
win.attroff(curses.color_pair(8)) win.attroff(curses.color_pair(8))
...@@ -191,8 +199,6 @@ class TextWin(object): ...@@ -191,8 +199,6 @@ class TextWin(object):
if user.nick == line[1]: if user.nick == line[1]:
break break
try: try:
try:win.addstr('\n['+line[0].strftime("%H:%M:%S") + "] <")
except:pass
length = len('['+line[0].strftime("%H:%M:%S") + "] <") length = len('['+line[0].strftime("%H:%M:%S") + "] <")
if line[1]: if line[1]:
win.attron(curses.color_pair(user.color)) win.attron(curses.color_pair(user.color))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment