Changeset 5251ec6 in sasview for src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
- Timestamp:
- Oct 11, 2018 12:20:56 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
- Children:
- 98b9f32
- Parents:
- 67ed543
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
r1cf490b6 r5251ec6 148 148 # Custom sorting 149 149 source_list = [] 150 for key, _ in self.source_mass.ite ritems():150 for key, _ in self.source_mass.items(): 151 151 name_source = str(key) 152 152 source_list.append(name_source) … … 667 667 Execute the computation of resolution 668 668 """ 669 # Clone the event before CallAfter; the event seems 670 # to delete the event when it is done processing, so 671 # the original will not be available when the call 672 # after method starts. 673 if event is not None: 674 event = event.Clone() 669 675 wx.CallAfter(self.on_compute_call, event) 670 676 … … 753 759 wx.MessageBox(msg, 'Warning') 754 760 return 755 #raise ValueError , "Invalid Q Input..."761 #raise ValueError("Invalid Q Input...") 756 762 757 763 # Validate the q inputs … … 934 940 def _sigma_strings(self): 935 941 """ 936 Recode sigmas as strin s942 Recode sigmas as strings 937 943 """ 938 944 sigma_r = self.format_number(self.resolution.sigma_1) … … 1082 1088 msg = "The numbers must be one or two (separated by ',')..." 1083 1089 self._status_info(msg, 'stop') 1084 raise RuntimeError , msg1090 raise RuntimeError(msg) 1085 1091 1086 1092 return new_string … … 1099 1105 value = float(string_split[ind]) 1100 1106 new_string.append(value) 1101 except :1102 logger.error( sys.exc_value)1107 except Exception as exc: 1108 logger.error(exc) 1103 1109 1104 1110 return new_string … … 1141 1147 out = self._string2inputlist(string) 1142 1148 return out 1143 except :1144 logger.error( sys.exc_value)1149 except Exception as exc: 1150 logger.error(exc) 1145 1151 1146 1152 def _on_xy_coordinate(self, event=None): … … 1269 1275 try: 1270 1276 basename = os.path.basename(path) 1271 if basename not in self.spectrum_dic .keys():1277 if basename not in self.spectrum_dic: 1272 1278 self.spectrum_cb.Append(basename) 1273 1279 self.spectrum_dic[basename] = self._read_file(path) … … 1286 1292 dlg = wx.FileDialog(self, 1287 1293 "Choose a wavelength spectrum file: Intensity vs. wavelength", 1288 self.parent.parent.get_save_location() , "", "*.*", wx. OPEN)1294 self.parent.parent.get_save_location() , "", "*.*", wx.FD_OPEN) 1289 1295 path = None 1290 1296 if dlg.ShowModal() == wx.ID_OK: … … 1318 1324 wavelength.append(wave) 1319 1325 intensity.append(intens) 1320 except :1326 except Exception as exc: 1321 1327 # Skip non-data lines 1322 logger.error( sys.exc_value)1328 logger.error(exc) 1323 1329 1324 1330 return [wavelength, intensity]
Note: See TracChangeset
for help on using the changeset viewer.