diff --git a/conf.py b/conf.py index 083f4f8..1830813 100644 --- a/conf.py +++ b/conf.py @@ -1,2 +1,3 @@ db_url = 'sqlite:///data' quit_allowed = True +show_tracebacks = True diff --git a/text_based.py b/text_based.py index 65d17df..f68e6ba 100644 --- a/text_based.py +++ b/text_based.py @@ -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.'