From 864dcffef83fb5227db5094e3942d3c191fc31fd Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 27 Nov 2020 17:55:06 +0100 Subject: [PATCH] bimtester: startscript, add argument to start gui with some start directories --- src/ifcbimtester/startbimtester.py | 33 ++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/ifcbimtester/startbimtester.py b/src/ifcbimtester/startbimtester.py index 1847126024..436a3c6703 100644 --- a/src/ifcbimtester/startbimtester.py +++ b/src/ifcbimtester/startbimtester.py @@ -7,7 +7,7 @@ from bimtester import reports from bimtester import run -def show_widget(): +def show_widget(features="", ifcfile=""): import sys from PySide2 import QtWidgets @@ -18,7 +18,7 @@ def show_widget(): app = QtWidgets.QApplication(sys.argv) # Create and show the form - form = GuiWidgetBimTester() + form = GuiWidgetBimTester(features, ifcfile) form.show() # Run the main Qt loop @@ -66,16 +66,41 @@ if __name__ == "__main__": "-g", "--gui", action="store_true", - help="Start with gui", + help=( + "Start the gui. The option t (run in temp directory) " + "is triggered automaticly." + ) ) + parser.add_argument( + "featuresdir", + type=str, + nargs="?", + help=( + "Specify a features directory. This should contain " + " a directory named features which contains all the " + "feature files." + ), + default="" + ) + parser.add_argument( + "ifcfile", + type=str, + nargs="?", + help=( + "Specify a ifc file." + ), + default="" + ) + args = vars(parser.parse_args()) + print(args) if args["purge"]: clean.TestPurger().purge() elif args["report"]: reports.generate_report() elif args["gui"]: - show_widget() + show_widget(args["featuresdir"], args["ifcfile"]) else: run.run_tests(args) print("# All tasks are complete :-)")