Konfigurasjonsflagg for hvorvidt tracebacks skal vises.
Fjernet et str-kall som fikk Python til å krangle om tegnkoding.
This commit is contained in:
parent
28d998f310
commit
105c625e1e
1
conf.py
1
conf.py
|
@ -1,2 +1,3 @@
|
|||
db_url = 'sqlite:///data'
|
||||
quit_allowed = True
|
||||
show_tracebacks = True
|
||||
|
|
|
@ -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.'
|
||||
|
|
Loading…
Reference in New Issue