MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / pb_file_clicked

Method pb_file_clicked

pyxrf/gui_module/tab_wd_load_data.py:295–313  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

293 self.le_wd.setText(dir)
294
295 def pb_file_clicked(self):
296 dir_current = self.gpc.get_current_working_directory()
297 file_paths = QFileDialog.getOpenFileName(self, "Open Data File", dir_current, "HDF5 (*.h5);; All (*)")
298 file_path = file_paths[0]
299 if file_path:
300 self.signal_loading_new_run.emit()
301
302 def cb(file_path):
303 result_dict = {}
304 try:
305 msg = self.gpc.open_data_file(file_path)
306 status = True
307 except Exception as ex:
308 msg = str(ex)
309 status = False
310 result_dict.update({"status": status, "msg": msg, "file_path": file_path})
311 return result_dict
312
313 self._compute_in_background(cb, self.slot_file_clicked, file_path=file_path)
314
315 @Slot(object)
316 def slot_file_clicked(self, result):

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected