From 59546320f16259b1bc8a1d397dd9c0203a0349f8 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 02:29:14 +0100 Subject: Format and typo fixes on Fireup plugin. --- bin/plugins/fireup.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/plugins/fireup.py b/bin/plugins/fireup.py index 3e1c750..7fe86ef 100755 --- a/bin/plugins/fireup.py +++ b/bin/plugins/fireup.py @@ -41,12 +41,10 @@ parser.add_argument( ) args = parser.parse_args() - # Store the path of this script and the main Salis simulation script. path = os.path.dirname(__file__) salis = os.path.join(path, "../salis.py") - # Revise that *all* listed files exist inside the './bin/sims/' directory. # Otherwise throw an exception. for fname in args.files: @@ -55,12 +53,10 @@ for fname in args.files: if not os.path.isfile(abs_path): parser.error("Save file '{}' not found.".format(abs_path)) - # Also, check that no file names are repeated. if len(args.files) != len(set(args.files)): parser.error("Repeated file name detected.") - # Everything seems OK! Let's fire up the TMUX sessions, one for every saved # file. Tmux sessions will be named similarly to their contained simulations. # We can, at any time, re-attach to any running session, or make use of all @@ -71,7 +67,7 @@ for fname in args.files: session = "salis-{}".format(fname).replace(".", "-") salis_cmd = "{} load -f {} -a {}".format(salis, fname, args.auto) subprocess.run(["tmux", "new-session", "-d", "-s", session]) - subprocess.run(["tmux", "send-keys", "-t", session, "{}".format(salis_cmd)]) + subprocess.run(["tmux", "send-keys", "-t", session, salis_cmd]) subprocess.run(["tmux", "send-keys", "-t", session, "Enter", "Space"]) print("New tmux session '{}' is running '{}' in the background.".format( session, fname -- cgit v1.2.1