Skip to content

Commit

Permalink
cleaned up nesting in REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
mbdriscoll committed Mar 20, 2011
1 parent 1221146 commit e0dbba8
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions console.py
Expand Up @@ -269,18 +269,17 @@ def complete(self, text, state):
if cmd:
tokens = re.split('\s*', cmd.strip())
cmdtoken = tokens[0]
if cmdtoken in COMMANDS.keys():
try:
COMMANDS[cmdtoken][0](tokens)
except NotLoggedInException:
print "You need to be logged in. Type 'login' to do so."
#except Exception as ex:
# print "Caught unexpected exception:", ex.value
# exc_type, exc_value, exc_traceback = sys.exc_info()
# traceback.print_exception(exc_type, exc_value, exc_traceback,
# limit=10, file=sys.stdout)
else:
print "Unknown command: %s" % tokens[0]
try:
COMMANDS[cmdtoken][0](tokens)
except NotLoggedInException:
print "You need to be logged in. Type 'login' to do so."
except KeyError:
print "Unknown command:", cmdtoken
#except Exception as ex:
# print "Caught unexpected exception:", ex.value
# exc_type, exc_value, exc_traceback = sys.exc_info()
# traceback.print_exception(exc_type, exc_value, exc_traceback,
# limit=10, file=sys.stdout)
except EOFError:
print
__handle__exit()
Expand Down

0 comments on commit e0dbba8

Please sign in to comment.