From ef75b9f70c7548562979fb5d02e2d328cf9d3db9 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Thu, 21 Jan 2010 04:41:54 +0000 Subject: couleurs en fonction du role des gens dans les salons --- src/gui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui.py b/src/gui.py index c69b5901..adae15e7 100644 --- a/src/gui.py +++ b/src/gui.py @@ -47,7 +47,7 @@ class User(object): self.role = role def change_nick(self, nick): - self.nick = nick + self.nick = nick.encode('utf-8') class Room(object): """ @@ -61,7 +61,7 @@ class Room(object): self.topic = '' def add_message(self, nick, msg): - self.lines.append((datetime.now(), nick, msg.encode('utf-8'))) + self.lines.append((datetime.now(), nick.encode('utf-8'), msg.encode('utf-8'))) def add_info(self, info): """ info, like join/quit/status messages""" @@ -131,6 +131,9 @@ class Gui(object): curses.noecho() curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE) curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK) + curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK) # Admin + curses.init_pair(4, curses.COLOR_BLUE, curses.COLOR_BLACK) # Participant + curses.init_pair(5, curses.COLOR_WHITE, curses.COLOR_BLACK) # Visitor def on_connected(self): pass -- cgit v1.2.3