From c6239b038b6277aaebf783c0b429134fa205c2f1 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Thu, 2 Mar 2023 18:49:30 +0200 Subject: [PATCH] add `--print-wokwi-id` flag for use in testbench --- project.py | 4 ++++ tt_tool.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/project.py b/project.py index 62b1bb8..d252111 100644 --- a/project.py +++ b/project.py @@ -10,6 +10,10 @@ def load_yaml(args): return (yaml.safe_load(stream)) +def print_wokwi_id(yaml): + print(yaml['project']['wokwi_id']) + + def create_user_config(yaml): logging.info("creating include file") sources = get_project_source(yaml) diff --git a/tt_tool.py b/tt_tool.py index 9a101f7..85a4fb6 100755 --- a/tt_tool.py +++ b/tt_tool.py @@ -18,6 +18,7 @@ if __name__ == '__main__': parser.add_argument('--print-cell-category', help="print category", action="store_const", const=True, default=False) parser.add_argument('--print-stats', help="print some stats from the run", action="store_const", const=True) parser.add_argument('--print-warnings', help="print any warnings", action="store_const", const=True) + parser.add_argument('--print-wokwi-id', help="prints the Wokwi project id", action="store_const", const=True) # documentation parser.add_argument('--check-docs', help="check the documentation part of the yaml", action="store_const", const=True) @@ -62,6 +63,9 @@ if __name__ == '__main__': if args.print_warnings: reports.print_warnings(args) + elif args.print_wokwi_id: + project.print_wokwi_id(project_yaml) + if args.create_user_config: project.create_user_config(project_yaml)