diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-18 19:43:44 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-18 19:43:44 +0000 |
commit | fc82ad6b3d3aa917fd70edfb73278356cce41ad4 (patch) | |
tree | e6c6b2314e86f7952981b94236b8cac7c5101b90 /src/client.py | |
parent | 5d7bb0fd6751e28320dad715e98bfe8112ee71f6 (diff) | |
download | poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.gz poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.bz2 poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.xz poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.zip |
fixed #1186
Diffstat (limited to 'src/client.py')
-rw-r--r-- | src/client.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/client.py b/src/client.py index 9840d259..9616be1c 100644 --- a/src/client.py +++ b/src/client.py @@ -18,10 +18,10 @@ # along with Poezio. If not, see <http://www.gnu.org/licenses/>. import sys + # disable any printout (this would mess the display) -stderr = sys.stderr -sys.stdout = open('/dev/null', 'w') -sys.stderr = open('/dev/null', 'w') +# sys.stdout = open('/dev/null', 'w') +# sys.stderr = open('/dev/null', 'w') from connection import Connection from multiuserchat import MultiUserChat @@ -30,22 +30,12 @@ from handler import Handler from gui import Gui from curses import initscr import curses +import threading +from common import exception_handler import signal signal.signal(signal.SIGINT, signal.SIG_IGN) -import traceback - -def exception_handler(type_, value, trace): - """ - on any traceback: exit ncurses and print the traceback - then exit the program - """ - curses.echo() - curses.endwin() - traceback.print_exception(type_, value, trace, None, stderr) - sys.exit() - sys.excepthook = exception_handler class Client(object): @@ -59,10 +49,12 @@ class Client(object): self.resource = config.get('resource', 'poezio') self.server = config.get('server', 'louiz.org') self.connection = Connection(self.server, self.resource) - self.stdscr = initscr() - + # self.connection.demon = True self.connection.start() + # self.connection.run() + self.stdscr = initscr() self.gui = Gui(self.stdscr, MultiUserChat(self.connection.client)) + # thread.start_new_thread(self.launch, ()) def launch(self): """ |