From 3a88f5516ac5fd5b4812156948cf21196a06aa96 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sat, 6 Oct 2012 17:12:54 +0200 Subject: [PATCH 1/3] Now prints exception messages on erros --- brathuhn.py | 1 + tell.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/brathuhn.py b/brathuhn.py index 9ba3605..62a5297 100644 --- a/brathuhn.py +++ b/brathuhn.py @@ -262,6 +262,7 @@ def loop(): print "-------ERROR OCCURED-------" exc_type, exc_value, exc_traceback = sys.exc_info() traceback.print_tb(exc_traceback, file=sys.stdout) + traceback.print_exc(file=sys.stdout) if not cl.connected: s=MIN_CONNECT_INTERVAL-(time.time()-last_connect) if s>0: diff --git a/tell.py b/tell.py index 9735559..a61413a 100644 --- a/tell.py +++ b/tell.py @@ -41,10 +41,10 @@ def tell(msg, args): def tellCB(nick, msg, status): global store + print "here" if(status != brathuhn.STATUS_JOIN): return - user = nick.getResource() rem = [] for l in store: From 6713d702853a079876dd1b12747785400c567b92 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sat, 6 Oct 2012 17:12:54 +0200 Subject: [PATCH 2/3] Now prints exception messages on erros --- brathuhn.py | 1 + tell.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/brathuhn.py b/brathuhn.py index 9ba3605..62a5297 100644 --- a/brathuhn.py +++ b/brathuhn.py @@ -262,6 +262,7 @@ def loop(): print "-------ERROR OCCURED-------" exc_type, exc_value, exc_traceback = sys.exc_info() traceback.print_tb(exc_traceback, file=sys.stdout) + traceback.print_exc(file=sys.stdout) if not cl.connected: s=MIN_CONNECT_INTERVAL-(time.time()-last_connect) if s>0: diff --git a/tell.py b/tell.py index 9735559..a61413a 100644 --- a/tell.py +++ b/tell.py @@ -41,10 +41,10 @@ def tell(msg, args): def tellCB(nick, msg, status): global store + print "here" if(status != brathuhn.STATUS_JOIN): return - user = nick.getResource() rem = [] for l in store: From 88be4a1053012c9615bca2261df825a92aee002d Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sat, 6 Oct 2012 17:43:01 +0200 Subject: [PATCH 3/3] Tell format change --- tell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tell.py b/tell.py index a61413a..a02dc5a 100644 --- a/tell.py +++ b/tell.py @@ -41,15 +41,15 @@ def tell(msg, args): def tellCB(nick, msg, status): global store - print "here" if(status != brathuhn.STATUS_JOIN): return + user = nick.getResource() rem = [] for l in store: if(l[0] == unicode(user)): - timestamp = "{:02}:{:02}, {}-{:02}-{:02}".format(l[3].hour, l[3].minute, l[3].year, l[3].month, l[3].day) + timestamp = "{0:02}:{1:02}, {2}-{3:02}-{4:02}".format(l[3].hour, l[3].minute, l[3].year, l[3].month, l[3].day) brathuhn.sendMsg(brathuhn.ROOM,(l[0]+": User "+l[2]+" told me at "+timestamp+" to tell you: \""+l[1]+"\""),'groupchat') rem.append(l)