@@ -38,7 +38,7 @@ def run():
3838
3939class GuiWidgetBimTester (QtWidgets .QWidget ):
4040 def __init__ (self , args = None ):
41- super (GuiWidgetBimTester , self ).__init__ ()
41+ super ().__init__ ()
4242
4343 if args is not None and args != {}:
4444 self .args = args
@@ -65,9 +65,7 @@ def __del__(self):
6565
6666 def _setup_ui (self ):
6767 package_path = os .path .dirname (os .path .realpath (__file__ ))
68- iconpath = os .path .join (
69- package_path , "resources" , "icons" , "bimtester.ico"
70- )
68+ iconpath = os .path .join (package_path , "resources" , "icons" , "bimtester.ico" )
7169
7270 """
7371 # as svg
@@ -105,14 +103,8 @@ def _setup_ui(self):
105103 _ifcfile_browse_btn .clicked .connect (self .select_ifcfile )
106104
107105 # buttons
108- self .run_button = QtWidgets .QPushButton (
109- QtGui .QIcon .fromTheme ("document-new" ),
110- "Run"
111- )
112- self .close_button = QtWidgets .QPushButton (
113- QtGui .QIcon .fromTheme ("window-close" ),
114- "Close"
115- )
106+ self .run_button = QtWidgets .QPushButton (QtGui .QIcon .fromTheme ("document-new" ), "Run" )
107+ self .close_button = QtWidgets .QPushButton (QtGui .QIcon .fromTheme ("window-close" ), "Close" )
116108 self .run_button .clicked .connect (self .run_bimtester )
117109 self .close_button .clicked .connect (self .close_widget )
118110 _buttons = QtWidgets .QHBoxLayout ()
@@ -139,9 +131,7 @@ def _setup_ui(self):
139131 self .setLayout (layout )
140132
141133 def select_ifcfile (self ):
142- ifcfile = QtWidgets .QFileDialog .getOpenFileName (
143- self , dir = self .get_ifcfile ()
144- )[0 ]
134+ ifcfile = QtWidgets .QFileDialog .getOpenFileName (self , dir = self .get_ifcfile ())[0 ]
145135 self .set_ifcfile (ifcfile )
146136
147137 def set_ifcfile (self , a_file ):
@@ -153,9 +143,7 @@ def get_ifcfile(self):
153143 return " " .join (self .ifcfile_text .text ().split ())
154144
155145 def select_featurefile (self ):
156- featurefile = QtWidgets .QFileDialog .getOpenFileName (
157- self , dir = self .get_ifcfile ()
158- )[0 ]
146+ featurefile = QtWidgets .QFileDialog .getOpenFileName (self , dir = self .get_ifcfile ())[0 ]
159147 self .set_featurefile (featurefile )
160148
161149 def set_featurefile (self , a_file ):
@@ -194,24 +182,15 @@ def run_bimtester(self):
194182 if has_feature_file is True and has_ifc_file is True :
195183 print ("Args passed from BIMtester GUI:" )
196184 print (json .dumps (self .args , indent = 4 ))
197- report_json = bimtester .run .TestRunner (
198- self .args ["ifc" ],
199- self .args ["schema_file" ]
200- ).run (self .args )
185+ report_json = bimtester .run .TestRunner (self .args ["ifc" ], self .args ["schema_file" ]).run (self .args )
201186 else :
202187 print ("Missing files, BIMTester can not run." )
203188 report_json = ""
204189
205190 # create html report
206191 if os .path .isfile (report_json ):
207- report_html = os .path .join (
208- os .path .dirname (os .path .realpath (report_json )),
209- "report.html"
210- )
211- bimtester .reports .ReportGenerator ().generate (
212- report_json ,
213- report_html
214- )
192+ report_html = os .path .join (os .path .dirname (os .path .realpath (report_json )), "report.html" )
193+ bimtester .reports .ReportGenerator ().generate (report_json , report_html )
215194 print ("HTML report generated: {}" .format (report_html ))
216195 elif report_json == "" :
217196 report_html = ""
0 commit comments