|
@@ -5,6 +5,7 @@ import time
|
|
|
|
|
|
import client_controller
|
|
|
from debug import debug
|
|
|
+from util import yn_dialog
|
|
|
|
|
|
|
|
|
def fake_loading_bar(msg, duration=5.):
|
|
@@ -74,7 +75,14 @@ allowed_commands = ['help',
|
|
|
|
|
|
|
|
|
def one_command():
|
|
|
- cmd = input('*> ').strip()
|
|
|
+ try:
|
|
|
+ cmd = input('*> ').strip()
|
|
|
+ except KeyboardInterrupt:
|
|
|
+ if yn_dialog('Do you want to exit Orderer?'):
|
|
|
+ exit_client()
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ return
|
|
|
cmds = cmd.split(';')
|
|
|
for cmd in cmds:
|
|
|
cmd = cmd.split()
|
|
@@ -94,6 +102,8 @@ def one_command():
|
|
|
print('Invalid command syntax.')
|
|
|
except ConnectionError:
|
|
|
print('There has been a problem connecting when to the server.')
|
|
|
+ except KeyboardInterrupt:
|
|
|
+ print('Interrupted')
|
|
|
except Exception as _:
|
|
|
print('An unknown error occurred while executing a command.')
|
|
|
|