From 07821c99f75c574bff76cb6c7ceefa4f3d597140 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 14:38:49 +0100 Subject: Cleanup: Format Python code to be mostly flake8 clean --- scripts/ingenish | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'scripts/ingenish') diff --git a/scripts/ingenish b/scripts/ingenish index ee53c4a5..4fac6307 100755 --- a/scripts/ingenish +++ b/scripts/ingenish @@ -15,15 +15,8 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import ingen -import os.path -import re import shlex import sys -import time -try: - import readline -except: - pass # Python 2 compatibility try: @@ -31,6 +24,7 @@ try: except NameError: pass + def print_usage(): print('''Usage: ingenish [OPTION]... [COMMAND [ARGUMENT]...] @@ -70,6 +64,7 @@ Example: set /main/tone/output ingen:value 0.7 ''') + def run(cmd): if cmd[0] == 'help': print_usage() @@ -91,6 +86,7 @@ def run(cmd): return ingen.delete(cmd[1]) return False + a = 1 server = 'unix:///tmp/ingen.sock' if len(sys.argv) > 1: @@ -110,12 +106,12 @@ if len(sys.argv) - a == 0: run(shlex.split(input('> '))) except (EOFError, KeyboardInterrupt, SystemExit): break - except: + except Exception: print('error: %s' % sys.exc_info()[1]) else: try: update = run(sys.argv[a:]) if update: print(update.serialize(format='n3')) - except: + except Exception: print('error: %s' % sys.exc_info()[1]) -- cgit v1.2.1