From 2e04c5c77e64a45e9ab8a23b8cb7a683630eb067 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 8 Sep 2011 17:05:02 +0200 Subject: =?UTF-8?q?c=20code=20that=20doesn=E2=80=99t=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/room.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/room.py') diff --git a/src/room.py b/src/room.py index 5d4c4ce6..1ca3f599 100644 --- a/src/room.py +++ b/src/room.py @@ -1,18 +1,9 @@ -# Copyright 2010-2011 Le Coz Florent +# Copyright 2010-2011 Florent Le Coz # # This file is part of Poezio. # # Poezio is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# Poezio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Poezio. If not, see . +# it under the terms of the MIT license. See the COPYING file. from text_buffer import TextBuffer, Message from datetime import datetime @@ -129,7 +120,9 @@ class Room(TextBuffer): nick_color = highlight time = time or datetime.now() message = Message(txt='%s\x19o'%(txt,), nick_color=nick_color, - time=time, nickname=nickname, user=user) + time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\ + if history else time.strftime("%H:%M:%S"),\ + nickname=nickname, user=user) while len(self.messages) > self.messages_nb_limit: self.messages.pop(0) self.messages.append(message) -- cgit v1.2.3