add --print-wokwi-id flag for use in testbench

This commit is contained in:
Uri Shaked
2023-03-02 18:49:30 +02:00
parent 9246dd85cd
commit c6239b038b
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -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)
+4
View File
@@ -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)