From 4faf53168d928f951189511d38e8e9e4976c74b0 Mon Sep 17 00:00:00 2001 From: alban Date: Fri, 9 Oct 2020 18:33:32 +0200 Subject: [PATCH] [fix] clitools runner should work --- clitools/runner.py | 14 ++++++++++++-- clitools/runner_lib.py | 11 +---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/clitools/runner.py b/clitools/runner.py index 32f5a75..ef27070 100755 --- a/clitools/runner.py +++ b/clitools/runner.py @@ -12,6 +12,16 @@ from pathlib import Path import runner_lib as runner + +def action_help(): + global bindings + print("\nKey\tAction\n--------------------------------------") + for i in bindings: + print(" {}\t{}".format(bindings[i],i)) + print("--------------------------------------\n") + + + bindings={ "Show playlist" : "l", "Launch [0-x] cmd" : "0-x", @@ -41,7 +51,7 @@ bindings={ # Main Loop runner.action_info() -runner.action_help() +action_help() print("\n\nLoad a playlist? [Y/n]: ") if "y" == runner.inkey() : runner.action_loadPlaylist() @@ -100,7 +110,7 @@ while True: runner.action_killPid() continue elif bindings["Help"] == k: - runner.action_help() + action_help() continue elif bindings["Information"] == k: runner.action_info() diff --git a/clitools/runner_lib.py b/clitools/runner_lib.py index ef7b49c..4cd5615 100644 --- a/clitools/runner_lib.py +++ b/clitools/runner_lib.py @@ -178,16 +178,6 @@ def action_listAll(): -def action_help(): - global bindings - print("\nKey\tAction\n--------------------------------------") - for i in bindings: - print(" {}\t{}".format(bindings[i],i)) - print("--------------------------------------\n") - - - - def action_edit(): print("Enter the command number to edit, or 'x' to abort.") @@ -359,6 +349,7 @@ def action_killPid(): def action_quit(): print("Quit [Y/n]?") + global process quit = inkey() if quit != "n": _kill(process)