summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-27 23:02:12 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-27 23:02:12 +0000
commite724584faa026c95362d85500351668b0d21290c (patch)
treee00a584c537005a286ac3beedae7e783d69c5274
parent40f3dad56bd5cdb05e970797e48f18d2fdb364dd (diff)
downloadpoezio-e724584faa026c95362d85500351668b0d21290c.tar.gz
poezio-e724584faa026c95362d85500351668b0d21290c.tar.bz2
poezio-e724584faa026c95362d85500351668b0d21290c.tar.xz
poezio-e724584faa026c95362d85500351668b0d21290c.zip
corrige la deconnexion sur les conneries du genre ctrl+x. Et desactive C-c en mode pas-debug
-rw-r--r--src/client.py4
-rw-r--r--src/connection.py6
-rw-r--r--src/gui.py4
-rw-r--r--src/window.py2
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)
diff --git a/src/gui.py b/src/gui.py
index 5845999b..fd47e4e5 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -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