Revision af569ab9
b/kamaki/cli/__init__.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
from kamaki.cli.argument import ArgumentParseManager |
40 | 40 |
from kamaki.cli.history import History |
41 |
from kamaki.cli.utils import print_dict, print_list, red, magenta, yellow
|
|
41 |
from kamaki.cli.utils import print_dict, red, magenta, yellow |
|
42 | 42 |
from kamaki.cli.errors import CLIError |
43 | 43 |
|
44 | 44 |
_help = False |
b/kamaki/cli/command_shell.py | ||
---|---|---|
100 | 100 |
def set_prompt(self, new_prompt): |
101 | 101 |
self.prompt = '%s%s%s' % (self._prefix, new_prompt, self._suffix) |
102 | 102 |
|
103 |
def cmdloop(self): |
|
104 |
while True: |
|
105 |
try: |
|
106 |
Cmd.cmdloop(self) |
|
107 |
except KeyboardInterrupt: |
|
108 |
print(' - interrupted') |
|
109 |
continue |
|
110 |
break |
|
111 |
|
|
103 | 112 |
def do_exit(self, line): |
104 | 113 |
print('') |
105 | 114 |
if self.prompt[len(self._prefix):-len(self._suffix)]\ |
... | ... | |
281 | 290 |
|
282 | 291 |
try: |
283 | 292 |
self.cmdloop() |
284 |
except Exception: |
|
293 |
except Exception as e: |
|
294 |
print('(%s)' % e) |
|
285 | 295 |
from traceback import print_stack |
286 | 296 |
print_stack() |
Also available in: Unified diff