From 5ce334019c1c4740c6b5fe9b8b6d8233511fb226 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Thu, 26 Nov 2020 07:38:50 +0100 Subject: [PATCH] bimtester: merge guibimtester into bimtester module --- src/ifcbimtester/README.md | 5 +++++ src/ifcbimtester/bimtester.py | 26 ++++++++++++++++++++++++++ src/ifcbimtester/guibimtester.py | 22 ---------------------- 3 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 src/ifcbimtester/guibimtester.py diff --git a/src/ifcbimtester/README.md b/src/ifcbimtester/README.md index 079f7f54bf..a02d4bf267 100644 --- a/src/ifcbimtester/README.md +++ b/src/ifcbimtester/README.md @@ -5,6 +5,11 @@ + ifcopenshell +### Start bimtester Gui from a shell +``` +python3 ./bimtester.py -g +``` + ### Create a binary out of the Python package + The commands needs to be updated + Unix: diff --git a/src/ifcbimtester/bimtester.py b/src/ifcbimtester/bimtester.py index 792886ef02..1847126024 100644 --- a/src/ifcbimtester/bimtester.py +++ b/src/ifcbimtester/bimtester.py @@ -7,6 +7,24 @@ from bimtester import reports from bimtester import run +def show_widget(): + + import sys + from PySide2 import QtWidgets + + from bimtester.guiwidget import GuiWidgetBimTester + + # Create the Qt Application + app = QtWidgets.QApplication(sys.argv) + + # Create and show the form + form = GuiWidgetBimTester() + form.show() + + # Run the main Qt loop + sys.exit(app.exec_()) + + if __name__ == "__main__": parser = argparse.ArgumentParser( @@ -44,12 +62,20 @@ if __name__ == "__main__": help="Specify your own arguments to Python's Behave", default="" ) + parser.add_argument( + "-g", + "--gui", + action="store_true", + help="Start with gui", + ) args = vars(parser.parse_args()) if args["purge"]: clean.TestPurger().purge() elif args["report"]: reports.generate_report() + elif args["gui"]: + show_widget() else: run.run_tests(args) print("# All tasks are complete :-)") diff --git a/src/ifcbimtester/guibimtester.py b/src/ifcbimtester/guibimtester.py deleted file mode 100644 index 000e4507a9..0000000000 --- a/src/ifcbimtester/guibimtester.py +++ /dev/null @@ -1,22 +0,0 @@ -# TODO merge into bimtester module - -import sys -from PySide2 import QtWidgets - -from bimtester.guiwidget import GuiWidgetBimTester - - -def show_widget(): - - # Create the Qt Application - app = QtWidgets.QApplication(sys.argv) - - # Create and show the form - form = GuiWidgetBimTester() - form.show() - - # Run the main Qt loop - sys.exit(app.exec_()) - -if __name__ == '__main__': - show_widget()