mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 13:58:12 +00:00
bimtester: move code into a package directory
This commit is contained in:
committed by
Dion Moult
parent
acb518613b
commit
32f99428c3
@@ -1,26 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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:
|
# Unix:
|
||||||
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features:features" bimtester.py`
|
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features:features" bimtester.py`
|
||||||
# Windows:
|
# Windows:
|
||||||
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features;features" bimtester.py`
|
# $ pyinstaller --onefile --clean --icon=icon.ico --add-data "features;features" bimtester.py`
|
||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import clean
|
from bimtester import clean
|
||||||
import reports
|
from bimtester import reports
|
||||||
import run
|
from bimtester import run
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -13,11 +13,15 @@ from .run import run_all
|
|||||||
class GuiWidgetBimTester(QtWidgets.QWidget):
|
class GuiWidgetBimTester(QtWidgets.QWidget):
|
||||||
|
|
||||||
# get some initial values
|
# 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"
|
initial_ifcfile = "/home/hugo/Documents/zeug_sort/z_some_ifc/example_model.ifc"
|
||||||
if not os.path.isfile(initial_ifcfile):
|
if not os.path.isfile(initial_ifcfile):
|
||||||
initial_ifcfile = os.path.join(os.path.expanduser("~"), "Desktop")
|
initial_ifcfile = desktop_path
|
||||||
this_path = os.path.join(os.path.dirname(__file__))
|
initial_featurespath = os.path.join(this_path, "..", "..", "features_bimtester", "fea_min")
|
||||||
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):
|
def __init__(self):
|
||||||
super(GuiWidgetBimTester, self).__init__()
|
super(GuiWidgetBimTester, self).__init__()
|
||||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
@@ -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()
|
||||||
Reference in New Issue
Block a user