try:
med_file_mesh = MEDFileMesh.New(file_path)
groups = list(med_file_mesh.getGroupsOnSpecifiedLev(-1))
- except:
+ except Exception as e:
+ print e.what()
return []
return groups
return line_edit
def setEditorData(self, editor, index):
- value, is_ok = index.model().data(index, Qt.EditRole).toInt()
-
- if is_ok:
- editor.setText(str(value))
+ value = index.model().data(index, Qt.EditRole)
+ if value.isdigit():
+ editor.setText(value)
else:
editor.setText('')
"""Select MED file"""
def on_med_file_browse(self):
# Get file path
- file_path = QFileDialog.getOpenFileName(self, self.tr("Open MED file"), "", self.tr("MED files (*.med)"))
+ file_path, filt = QFileDialog.getOpenFileName(self, self.tr("Open MED file"), "", self.tr("MED files (*.med)"))
if not file_path:
return
"""Select boundary conditions file"""
def on_bnd_file_browse(self):
- file_path = QFileDialog.getOpenFileName(self, self.tr("Open boundary conditions file"))
+ file_path, filt = QFileDialog.getOpenFileName(self, self.tr("Open boundary conditions file"))
if file_path:
self.bndConditionsFileEdit.setText(file_path)
if preset and self.presets.has_key(preset):
values = self.presets[preset]
- row_nb, is_ok = combo.property(ROW_PROPERTY_NAME).toInt()
+ row_nb = combo.property(ROW_PROPERTY_NAME)
- if is_ok and row_nb >= 0 and row_nb < self.boundaryConditionsTable.rowCount():
+ if row_nb >= 0 and row_nb < self.boundaryConditionsTable.rowCount():
lihbor = values[0]
liubor = values[1]
livbor = values[2]
"""Define result file path"""
def on_result_file_browse(self):
- file_path = QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
+ file_path, filt = QFileDialog.getSaveFileName(self, self.tr("Select output file path"))
+ #print file_path
if file_path:
self.resultBndConditionsFileEdit.setText(file_path)
if self.boundaryConditionsTable.rowCount() < 1:
QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Boundary conditions list is empty."))
- elif self.get_output_path().isEmpty():
+ elif len(self.get_output_path())==0:
QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Output file path is empty."))
else:
has_empty_cells = False
Click on "Close" button does not lead to saving the data and just closes the dialog.
"""
QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
- pass
\ No newline at end of file
+ pass