diff options
-rw-r--r-- | src/client.py | 4 | ||||
-rw-r--r-- | src/connection.py | 6 | ||||
-rw-r--r-- | src/gui.py | 4 | ||||
-rw-r--r-- | src/window.py | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/client.py b/src/client.py index df7f62d5..db1af8fe 100644 --- a/src/client.py +++ b/src/client.py @@ -25,8 +25,10 @@ from handler import Handler from gui import Gui from curses import wrapper, initscr -if len(sys.argv) == 1: # not debug, so hide any error message +if len(sys.argv) == 1: # not debug, so hide any error message and disable C-c + import signal sys.stderr = open('/dev/null', 'a') + signal.signal(signal.SIGINT, signal.SIG_IGN) class Client(object): """ diff --git a/src/connection.py b/src/connection.py index f586eb01..94167c75 100644 --- a/src/connection.py +++ b/src/connection.py @@ -77,6 +77,7 @@ class Connection(Thread): self.client.RegisterHandler('message', self.handler_message) self.client.RegisterHandler('presence', self.handler_presence) self.client.RegisterHandler('iq', self.handler_iq) + self.client.RegisterHandler('error', self.handler_error) def handler_presence(self, connection, presence): fro = presence.getFrom() @@ -94,6 +95,11 @@ class Connection(Thread): def handler_iq(self, connection, iq): pass + def handler_error(self, connection, error): + import sys + print "TOUCHE FION" + sys.exit() + def process(self, timeout=10): if self.online: try:self.client.Process(timeout) @@ -154,6 +154,8 @@ class Gui(object): self.execute() elif ord(key) == 8 or ord(key) == 127: self.window.input.key_backspace() + elif ord(key) < 32: + continue else: if ord(key) == 27 and ord(stdscr.getkey()) == 91 \ and ord(stdscr.getkey()) == 51: # FIXME: ugly ugly workaroung. @@ -202,12 +204,10 @@ class Gui(object): def rotate_rooms_left(self, args): self.rooms.append(self.rooms.pop(0)) - self.stdscr.touchwin() self.window.refresh(self.current_room()) def rotate_rooms_right(self, args): self.rooms.insert(0, self.rooms.pop()) -# self.stdscr.touchwin() self.window.refresh(self.current_room()) def room_message(self, stanza): diff --git a/src/window.py b/src/window.py index 382e88de..1baefa42 100644 --- a/src/window.py +++ b/src/window.py @@ -164,8 +164,6 @@ class Input(Win): """ def __init__(self, height, width, y, x, stdscr): Win.__init__(self, height, width, y, x, stdscr) - # self.input = curses.textpad.Textbox(self.win) - # self.input.insert_mode = True self.history = [] self.text = u'' self.pos = 0 |