From 0216ac29dbcf49865e145db42d9fbcfcd2bebd19 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Mon, 15 Nov 2010 13:16:30 +0000 Subject: Do not refresh the screen on each input --- src/buffers.py | 1 + src/connection.py | 1 - src/core.py | 8 +++++--- src/room.py | 2 +- src/tab.py | 14 +++++++++----- 5 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/buffers.py b/src/buffers.py index d4af680d..31e227dc 100644 --- a/src/buffers.py +++ b/src/buffers.py @@ -491,6 +491,7 @@ class TextWin(Win): if txt.startswith('\n'): txt = txt[1:] first = False + log.debug('%s built\n' % len(lines)) return lines return lines[-len(messages):] # return only the needed number of lines diff --git a/src/connection.py b/src/connection.py index 2f016901..e313af37 100644 --- a/src/connection.py +++ b/src/connection.py @@ -26,7 +26,6 @@ import sleekxmpp from config import config from logger import logger -from handler import Handler class Connection(sleekxmpp.ClientXMPP): """ diff --git a/src/core.py b/src/core.py index ce271613..2d595cb3 100644 --- a/src/core.py +++ b/src/core.py @@ -822,8 +822,8 @@ class Core(object): body = message['body'] if body: date = date if delayed == True else None - if not delayed: - logger.groupchat(room_from, nick_from, body) + # if not delayed: + # logger.groupchat(room_from, nick_from, body) self.add_message_to_text_buffer(room, body, date, nick_from) self.refresh_window() self.doupdate() @@ -1344,7 +1344,9 @@ class Core(object): if not key: return res = self.current_tab().on_input(key) - self.refresh_window() + if res: + log.debug('RES is true') + self.refresh_window() def on_roster_enter_key(self, roster_row): """ diff --git a/src/room.py b/src/room.py index 8a755e18..5325373a 100644 --- a/src/room.py +++ b/src/room.py @@ -96,7 +96,7 @@ class Room(TextBuffer): when we receive an history message said by someone who is not in the room anymore """ - self.log_message(txt, time, nickname) + # self.log_message(txt, time, nickname) if txt.startswith('/me '): txt = "* " + nickname + ' ' + txt[4:] nickname = None diff --git a/src/tab.py b/src/tab.py index bef42be8..17e51476 100644 --- a/src/tab.py +++ b/src/tab.py @@ -254,8 +254,10 @@ class MucTab(Tab): "\n": self.on_enter } if key in key_func: - return key_func[key]() - return self.input.do_command(key) + key_func[key]() + return False + self.input.do_command(key) + return False def completion(self): """ @@ -373,7 +375,8 @@ class PrivateTab(Tab): "\n": self.on_enter } if key in key_func: - return key_func[key]() + key_func[key]() + return False return self.input.do_command(key) def on_enter(self): @@ -471,7 +474,7 @@ class RosterInfoTab(Tab): } res = self.input.do_command(key) if res: - return res + return False if key in key_commands: return key_commands[key]() @@ -621,7 +624,8 @@ class ConversationTab(Tab): "\n": self.on_enter } if key in key_func: - return key_func[key]() + key_func[key]() + return False return self.input.do_command(key) -- cgit v1.2.3