diff --git a/src/ifcbimtester/bimtester.py b/src/ifcbimtester/bimtester.py index 8043d9040b..c33121b6fd 100644 --- a/src/ifcbimtester/bimtester.py +++ b/src/ifcbimtester/bimtester.py @@ -1,26 +1,15 @@ #!/usr/bin/env python3 -# Bernd: IMHO, this should go one lever up, -# or all other code should go one level down -# https://stackoverflow.com/questions/16981921/relative-imports-in-python-3 - - -# ATM bimtester code is copied here for for the sake of convenience -# TODO bimtester should be installed in conjunction with ifcopenshell -# to /urs/local by make install - - # Unix: # $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features:features" bimtester.py` # Windows: # $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features;features" bimtester.py` - import argparse -import clean -import reports -import run +from bimtester import clean +from bimtester import reports +from bimtester import run if __name__ == "__main__": diff --git a/src/ifcbimtester/__init__.py b/src/ifcbimtester/bimtester/__init__.py similarity index 100% rename from src/ifcbimtester/__init__.py rename to src/ifcbimtester/bimtester/__init__.py diff --git a/src/ifcbimtester/clean.py b/src/ifcbimtester/bimtester/clean.py similarity index 100% rename from src/ifcbimtester/clean.py rename to src/ifcbimtester/bimtester/clean.py diff --git a/src/ifcbimtester/features/environment.py b/src/ifcbimtester/bimtester/features/environment.py similarity index 100% rename from src/ifcbimtester/features/environment.py rename to src/ifcbimtester/bimtester/features/environment.py diff --git a/src/ifcbimtester/features/steps/classification.py b/src/ifcbimtester/bimtester/features/steps/classification.py similarity index 100% rename from src/ifcbimtester/features/steps/classification.py rename to src/ifcbimtester/bimtester/features/steps/classification.py diff --git a/src/ifcbimtester/features/steps/element_classes.py b/src/ifcbimtester/bimtester/features/steps/element_classes.py similarity index 100% rename from src/ifcbimtester/features/steps/element_classes.py rename to src/ifcbimtester/bimtester/features/steps/element_classes.py diff --git a/src/ifcbimtester/features/steps/geocoding.py b/src/ifcbimtester/bimtester/features/steps/geocoding.py similarity index 100% rename from src/ifcbimtester/features/steps/geocoding.py rename to src/ifcbimtester/bimtester/features/steps/geocoding.py diff --git a/src/ifcbimtester/features/steps/geolocation.py b/src/ifcbimtester/bimtester/features/steps/geolocation.py similarity index 100% rename from src/ifcbimtester/features/steps/geolocation.py rename to src/ifcbimtester/bimtester/features/steps/geolocation.py diff --git a/src/ifcbimtester/features/steps/geometric_detail.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail.py similarity index 100% rename from src/ifcbimtester/features/steps/geometric_detail.py rename to src/ifcbimtester/bimtester/features/steps/geometric_detail.py diff --git a/src/ifcbimtester/features/steps/model_federation.py b/src/ifcbimtester/bimtester/features/steps/model_federation.py similarity index 100% rename from src/ifcbimtester/features/steps/model_federation.py rename to src/ifcbimtester/bimtester/features/steps/model_federation.py diff --git a/src/ifcbimtester/features/steps/project_setup.py b/src/ifcbimtester/bimtester/features/steps/project_setup.py similarity index 100% rename from src/ifcbimtester/features/steps/project_setup.py rename to src/ifcbimtester/bimtester/features/steps/project_setup.py diff --git a/src/ifcbimtester/features/steps/steps.py b/src/ifcbimtester/bimtester/features/steps/steps.py similarity index 100% rename from src/ifcbimtester/features/steps/steps.py rename to src/ifcbimtester/bimtester/features/steps/steps.py diff --git a/src/ifcbimtester/features/steps/utils.py b/src/ifcbimtester/bimtester/features/steps/utils.py similarity index 100% rename from src/ifcbimtester/features/steps/utils.py rename to src/ifcbimtester/bimtester/features/steps/utils.py diff --git a/src/ifcbimtester/features/template.html b/src/ifcbimtester/bimtester/features/template.html similarity index 100% rename from src/ifcbimtester/features/template.html rename to src/ifcbimtester/bimtester/features/template.html diff --git a/src/ifcbimtester/guiwidget.py b/src/ifcbimtester/bimtester/guiwidget.py similarity index 96% rename from src/ifcbimtester/guiwidget.py rename to src/ifcbimtester/bimtester/guiwidget.py index 7115da342c..a1f0d63dce 100644 --- a/src/ifcbimtester/guiwidget.py +++ b/src/ifcbimtester/bimtester/guiwidget.py @@ -13,11 +13,15 @@ from .run import run_all class GuiWidgetBimTester(QtWidgets.QWidget): # get some initial values + this_path = os.path.join(os.path.dirname(__file__)) + desktop_path = os.path.join(os.path.expanduser("~"), "Desktop") + initial_ifcfile = "/home/hugo/Documents/zeug_sort/z_some_ifc/example_model.ifc" if not os.path.isfile(initial_ifcfile): - initial_ifcfile = os.path.join(os.path.expanduser("~"), "Desktop") - this_path = os.path.join(os.path.dirname(__file__)) - initial_featurespath = os.path.join(this_path, "..", "features_bimtester", "fea_min") + initial_ifcfile = desktop_path + initial_featurespath = os.path.join(this_path, "..", "..", "features_bimtester", "fea_min") + if not os.path.isdir(initial_featurespath): + initial_featurespath = desktop_path def __init__(self): super(GuiWidgetBimTester, self).__init__() diff --git a/src/ifcbimtester/reports.py b/src/ifcbimtester/bimtester/reports.py similarity index 100% rename from src/ifcbimtester/reports.py rename to src/ifcbimtester/bimtester/reports.py diff --git a/src/ifcbimtester/resources/icons/bimtester.ico b/src/ifcbimtester/bimtester/resources/icons/bimtester.ico similarity index 100% rename from src/ifcbimtester/resources/icons/bimtester.ico rename to src/ifcbimtester/bimtester/resources/icons/bimtester.ico diff --git a/src/ifcbimtester/run.py b/src/ifcbimtester/bimtester/run.py similarity index 100% rename from src/ifcbimtester/run.py rename to src/ifcbimtester/bimtester/run.py diff --git a/src/ifcbimtester/guibimtester.py b/src/ifcbimtester/guibimtester.py new file mode 100644 index 0000000000..000e4507a9 --- /dev/null +++ b/src/ifcbimtester/guibimtester.py @@ -0,0 +1,22 @@ +# 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()