Konfigurasjonsflagg for hvorvidt tracebacks skal vises.

Fjernet et str-kall som fikk Python til å krangle om tegnkoding.
This commit is contained in:
Øystein Ingmar Skartsæterhagen 2010-05-11 16:38:30 +00:00
parent 28d998f310
commit 105c625e1e
2 changed files with 5 additions and 1 deletions

View File

@ -1,2 +1,3 @@
db_url = 'sqlite:///data'
quit_allowed = True
show_tracebacks = True

View File

@ -3,6 +3,7 @@
import sqlalchemy
import re
import sys
import traceback
from helpers import *
exit_commands = ['exit', 'abort', 'quit', 'bye', 'eat flaming death']
@ -68,7 +69,7 @@ class Menu():
elif isinstance(self.items[i], tuple):
return self.items[i][1]
else:
return str(self.items[i])
return self.items[i]
def item_value(self, i):
if isinstance(self.items[i], tuple):
@ -645,6 +646,8 @@ while True:
except:
print 'Something went wrong.'
print '%s: %s' % sys.exc_info()[0:2]
if conf.show_tracebacks:
traceback.print_tb(sys.exc_info()[2])
else:
break
print 'Restarting main menu.'