aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:14 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:14 +0100
commit59546320f16259b1bc8a1d397dd9c0203a0349f8 (patch)
tree3c441f9ced5ced6ab6bc942cf221ea11c0097694 /bin
parent9021b27c9b8a7f05e01ab3e3498d8fb99ec6b53f (diff)
Format and typo fixes on Fireup plugin.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/plugins/fireup.py6
1 files changed, 1 insertions, 5 deletions
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