summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-07-27 11:09:56 +0200
committerSanto Cariotti <sancn@live.com>2017-07-27 11:09:56 +0200
commit023de75d6e4b10c058b92f6463e2cfe5fb71bb55 (patch)
tree8ac6b83ca30c3e979db1ad4a9167dd1a4667114f
parent686d2792ffcb6f30c85eb952bea30e3f14b7ec91 (diff)
fixed interrupts
-rw-r--r--lib/app.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/app.py b/lib/app.py
index 169fcea..e8f44ad 100644
--- a/lib/app.py
+++ b/lib/app.py
@@ -36,7 +36,7 @@ class Stout(Commands):
else:
cmd = cmd.split()
count = len(cmd)
-
+
if (count == 1 or count == 2) and cmd[0] not in ListCommands.commands:
try:
if cmd[0] == 'info' and count == 1: #general info
@@ -48,12 +48,14 @@ class Stout(Commands):
except (KeyError, IndexError):
ListCommands.err('keyword')
else:
- what = cmd[0]
- if what in ListCommands.commands:
- self.command(what, cmd)
- else:
- ListCommands.err('keyword')
-
+ try:
+ what = cmd[0]
+ if what in ListCommands.commands:
+ self.command(what, cmd)
+ else:
+ ListCommands.err('keyword')
+ except IndexError:
+ pass
if __name__ == '__main__':
clear()
@@ -62,7 +64,7 @@ if __name__ == '__main__':
while cmd != 'quit':
try:
cmd = input('>' + Colors.yellow + app.getName() + Colors.black)
- except EOFError:
+ except (EOFError, KeyboardInterrupt) as e:
break
app.action(cmd)