diff options
author | Santo Cariotti <sancn@live.com> | 2017-07-27 11:09:56 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-07-27 11:09:56 +0200 |
commit | 023de75d6e4b10c058b92f6463e2cfe5fb71bb55 (patch) | |
tree | 8ac6b83ca30c3e979db1ad4a9167dd1a4667114f | |
parent | 686d2792ffcb6f30c85eb952bea30e3f14b7ec91 (diff) |
fixed interrupts
-rw-r--r-- | lib/app.py | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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) |