summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-27 22:29:28 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-27 22:29:28 +0000
commit5a3f8ef18dd03ee2b6ff6265b96ff85bc25f5007 (patch)
tree72f8f5cbd6f8582ff43830ca2c5ae05c3253d067
parent9d5d96c5b02836e32d398127883c702f954fd96e (diff)
downloadpoezio-5a3f8ef18dd03ee2b6ff6265b96ff85bc25f5007.tar.gz
poezio-5a3f8ef18dd03ee2b6ff6265b96ff85bc25f5007.tar.bz2
poezio-5a3f8ef18dd03ee2b6ff6265b96ff85bc25f5007.tar.xz
poezio-5a3f8ef18dd03ee2b6ff6265b96ff85bc25f5007.zip
on PEUT effacer des caractères :o
-rw-r--r--src/connection.py4
-rw-r--r--src/gui.py7
-rw-r--r--src/window.py7
3 files changed, 13 insertions, 5 deletions
diff --git a/src/connection.py b/src/connection.py
index 8185994f..f586eb01 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -96,7 +96,9 @@ class Connection(Thread):
def process(self, timeout=10):
if self.online:
- self.client.Process(timeout)
+ try:self.client.Process(timeout)
+ except:
+ pass
else:
log.warning('disconnecting...')
sys.exit()
diff --git a/src/gui.py b/src/gui.py
index 56a26526..8595e238 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -90,7 +90,7 @@ class Room(object):
return self.add_info("%s is in the room" % (nick))
change_nick = stanza.getStatusCode() == '303'
for user in self.users:
- if user.nick.encode('utf-8') == nick.encode('utf-8'):
+ if user.nick == nick:
if change_nick:
user.change_nick(stanza.getNick())
return self.add_info('%s is now known as %s' % (nick, stanza.getNick()))
@@ -132,6 +132,7 @@ class Gui(object):
"KEY_END": self.window.input.key_end,
"KEY_HOME": self.window.input.key_home,
"KEY_DOWN": self.window.input.key_down,
+ "KEY_DC": self.window.input.key_dc,
"KEY_BACKSPACE": self.window.input.key_backspace
}
@@ -151,6 +152,8 @@ class Gui(object):
continue
elif ord(key) == 10:
self.execute()
+ elif ord(key) == 8:
+ self.window.input.key_backspace()
else:
if ord(key) > 190 and ord(key) < 225:
key = key+stdscr.getkey()
@@ -250,7 +253,7 @@ class Gui(object):
if command in self.commands.keys():
func = self.commands[command]
func(args)
- return
+ return
if self.current_room().name != 'Info':
self.muc.send_message(self.current_room().name, line)
self.window.input.refresh()
diff --git a/src/window.py b/src/window.py
index be9416fd..55910031 100644
--- a/src/window.py
+++ b/src/window.py
@@ -241,8 +241,11 @@ class Input(Win):
def do_command(self, key):
(y, x) = self.win.getyx()
- self.text = self.text[:self.pos]+key.decode('utf-8')+self.text[self.pos:]
- self.win.insstr(key)
+ try:
+ self.text = self.text[:self.pos]+key.decode('utf-8')+self.text[self.pos:]
+ self.win.insstr(key)
+ except:
+ return
self.win.move(y, x+1)
self.pos += 1