From f86d56d159c82f7a41cd782455a469d80f3e5857 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Thu, 14 Nov 2024 19:08:15 -0800 Subject: [PATCH 1/2] Resolves #850. --- workbench | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/workbench b/workbench index 890cde92..058e698f 100755 --- a/workbench +++ b/workbench @@ -15,6 +15,8 @@ import collections import subprocess import requests_cache from progress_bar import InitBar +from rich.console import Console +from rich.table import Table from ruamel.yaml import YAML from workbench_utils import * import workbench_fields @@ -3467,6 +3469,11 @@ parser.add_argument( parser.add_argument( "--contactsheet", help="Generate a contact sheet.", action="store_true" ) +parser.add_argument( + "--print_config", + help="Prints out the current configuration settings.", + action="store_true", +) parser.add_argument( "--skip_user_prompts", help='Include to skip any user prompts defined in your config file\'s "user_prompts" setting.', @@ -3491,6 +3498,21 @@ except Exception as e: sys.exit(str(e)) config = workbench_config.get_config() +if args.print_config is True: + print("\nCurrent Islandora Workbench configuration, including defaults") + table = Table() + table.add_column("Config setting", justify="left") + table.add_column("Value", justify="left") + for key, value in config.items(): + if key == "password": + table.add_row(key, "xxxxxxxxxx") + else: + table.add_row(key, str(value)) + + console = Console() + console.print(table) + sys.exit() + if args.check is not True and config["remind_user_to_run_check"] is True: if args.skip_user_prompts is not True: user_has_run_check = input("Have you run --check? (y/n)") From 72ccb9751b43cd0b362c7837ee329500242433c1 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Tue, 19 Nov 2024 07:23:27 -0800 Subject: [PATCH 2/2] Resolves #792. --- workbench | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/workbench b/workbench index 058e698f..7b27afcd 100755 --- a/workbench +++ b/workbench @@ -3479,6 +3479,22 @@ parser.add_argument( help='Include to skip any user prompts defined in your config file\'s "user_prompts" setting.', action="store_true", ) +parser.add_argument( + "--input_csv", + help="Overrides the 'input_csv' configuration setting.", +) +parser.add_argument( + "--input_dir", + help="Overrides the 'input_dir' configuration setting.", +) +parser.add_argument( + "--google_sheets_gid", + help="Overrides the 'google_sheets_gid' configuration setting.", +) +parser.add_argument( + "--log_file_path", + help="Overrides the 'log_file_path' configuration setting.", +) parser.add_argument("--version", action="version", version="Islandora Workbench 0.0.0") args = parser.parse_args() @@ -3498,6 +3514,15 @@ except Exception as e: sys.exit(str(e)) config = workbench_config.get_config() +if args.input_csv is not None: + config["input_csv"] = args.input_csv +if args.input_csv is not None: + config["google_sheets_gid"] = args.google_sheets_gid +if args.input_dir is not None: + config["input_dir"] = args.input_dir +if args.log_file_path is not None: + config["log_file_path"] = args.log_file_path + if args.print_config is True: print("\nCurrent Islandora Workbench configuration, including defaults") table = Table()