From baa1e62b57a7323567cddb1b5973ef9c9b733be9 Mon Sep 17 00:00:00 2001 From: Nick Rossenbach Date: Wed, 31 Aug 2022 17:56:18 +0200 Subject: [PATCH] add setup_job_directory shortcut --- sisyphus/shortcuts.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sisyphus/shortcuts.py b/sisyphus/shortcuts.py index 586de71..86c29b9 100644 --- a/sisyphus/shortcuts.py +++ b/sisyphus/shortcuts.py @@ -89,6 +89,15 @@ def add_subparsers(parsers): help='All config files that will be loaded') parser_remove_job_and_descendants.set_defaults(func=remove_job_and_descendants) + parser_setup_job_directory = sc_subparsers.add_parser( + "setup_job_directory", + help="setup a job that is marked as runnable manually" + ) + parser_setup_job_directory.add_argument("--job", help="job path") + parser_setup_job_directory.add_argument('argv', metavar='ARGV', type=str, nargs='*', + help='All config files that will be loaded') + parser_setup_job_directory.set_defaults(func=setup_job_directory) + def clean_unused(args): if args.load_used_path: @@ -179,6 +188,12 @@ def remove_job_and_descendants(args): call_sis(call) +def setup_job_directory(args): + for conf_file in args.argv: + call = ['console', conf_file, '--script', '-c', + 'tk.setup_job_directory(tk.sis_graph.find("%s")[0])' % (args.job)] + call_sis(call) + def call_sis(call): p = subprocess.Popen(tk.gs.SIS_COMMAND + call, start_new_session=True) p.wait()