Changeset 5251ec6 in sasview for src/sas/sasgui/perspectives/invariant/invariant.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/invariant/invariant.py
r7432acb r5251ec6 133 133 name = data.__class__.__name__ 134 134 msg = "Invariant use only Data1D got: [%s] " % str(name) 135 raise ValueError , msg135 raise ValueError(msg) 136 136 self.compute_helper(data=data) 137 137 … … 144 144 if data_list is None: 145 145 data_list = [] 146 else: 147 data_list = list(data_list) # force iterator to list 146 148 if len(data_list) >= 1: 147 149 if len(data_list) == 1: … … 190 192 try: 191 193 self.compute_helper(data) 192 except :193 msg = "Invariant Set_data: " + str( sys.exc_value)194 except Exception as exc: 195 msg = "Invariant Set_data: " + str(exc) 194 196 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error")) 195 197 else: … … 240 242 msg = "invariant.save_file: the data being saved is" 241 243 msg += " not a sas.sascalc.dataloader.data_info.Data1D object" 242 raise RuntimeError , msg244 raise RuntimeError(msg) 243 245 244 246 def set_state(self, state=None, datainfo=None): … … 258 260 msg = "invariant.set_state: datainfo parameter cannot" 259 261 msg += " be None in standalone mode" 260 raise RuntimeError , msg262 raise RuntimeError(msg) 261 263 # Make sure the user sees the invariant panel after loading 262 264 # self.parent.set_perspective(self.perspective) … … 281 283 self.on_set_state_helper(None) 282 284 283 except :284 logger.error("invariant.set_state: %s" % sys.exc_value)285 except Exception as exc: 286 logger.error("invariant.set_state: %s" % exc) 285 287 286 288 def on_set_state_helper(self, event=None): … … 320 322 else: 321 323 msg = "Scale can not be zero." 322 raise ValueError , msg324 raise ValueError(msg) 323 325 if len(new_plot.x) == 0: 324 326 return
Note: See TracChangeset
for help on using the changeset viewer.