From bb92c63a2c050ec9042327ba62ea5b9e06b45720 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Tue, 20 Jul 2010 17:25:41 +0000 Subject: fix backspace key, error messages not displayed, and other stuff --- src/common.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/common.py') diff --git a/src/common.py b/src/common.py index 456f73e5..b71f84fc 100644 --- a/src/common.py +++ b/src/common.py @@ -33,6 +33,7 @@ """ various useful functions """ + from datetime import datetime, timedelta import base64 import os @@ -45,35 +46,6 @@ import select import errno import time -class MyStdErr(object): - def __init__(self, fd): - """ - Change sys.stderr to something like /dev/null - to disable any printout on the screen that would - mess everything - """ - self.old_stderr = sys.stderr - sys.stderr = fd - def restaure(self): - """ - Restaure the good ol' sys.stderr, because we need - it in order to print the tracebacks - """ - sys.stderr = self.old_stderr - -my_stderr = MyStdErr(open('/dev/null', 'a')) - -def exception_handler(type_, value, trace): - """ - on any traceback: exit ncurses and print the traceback - then exit the program - """ - my_stderr.restaure() - curses.endwin() - curses.echo() - traceback.print_exception(type_, value, trace, None, sys.stderr) - sys.exit(2) - import xmpp def debug(string): -- cgit v1.2.3