summaryrefslogtreecommitdiffstats
path: root/cholerab/cholerab-live/view.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2011-07-24 04:56:05 +0200
committermakefu <github@syntax-fehler.de>2011-07-24 04:56:05 +0200
commit2862f1ad4ef0439721779a1a93e29bc5dc1c84de (patch)
tree1a5403078e32ea6f0dc031dfb650f5a6d5914307 /cholerab/cholerab-live/view.py
parentf1f12489514f47f9154f8e4b6232399e747cfcd8 (diff)
added robustness, removed utf8 support
to be able to send special characters over the line the characters are translated into their number value and written as string. this essentially breaks utf-8 support for the clients, needs to be fixed some time later added ignore for own messages, message colorization
Diffstat (limited to 'cholerab/cholerab-live/view.py')
-rw-r--r--cholerab/cholerab-live/view.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/cholerab/cholerab-live/view.py b/cholerab/cholerab-live/view.py
index 3d5cd873..29608a7d 100644
--- a/cholerab/cholerab-live/view.py
+++ b/cholerab/cholerab-live/view.py
@@ -12,7 +12,7 @@ class CursesView(threading.Thread):
adds a char at the current cursor position
abstraction to the curses win.addch()
"""
- try: self.win.addch(char)
+ try: self.win.addch(char,2)
except: pass
self.cholerab.send_char(self.x,self.y,chr(char))
def stop(self):
@@ -49,7 +49,11 @@ class CursesView(threading.Thread):
log.info('backspace pressed')
self.x -=1;
self.x,self.y = try_move(self.x,self.y)
- self.win.addch(' ')
+ self.addch(ord(' '))
+ elif c == ord('\n'):
+ log.info('enter pressed')
+ self.y +=1;
+ self.x,self.y = try_move(self.x,self.y)
else :
self.addch(c)
self.x +=1
@@ -58,7 +62,7 @@ class CursesView(threading.Thread):
def write_char(self,x,y,char,user=1):
user = user % 3 + 1
- self.win.addch(y,x,char)
+ self.win.addch(y,x,char,color_pair(user))
self.win.move(self.y,self.x)
self.refresh()
def write_str(self,x,y,string,user=1):