Changeset fa81e94 in sasview for src/sas/sasgui/perspectives/invariant/invariant_panel.py
- Timestamp:
- Nov 15, 2017 2:33:09 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- d4881f6a
- Parents:
- 7c487846
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/invariant/invariant_panel.py
- Property mode changed from 100644 to 100755
r7432acb rfa81e94 318 318 background = self.background_tcl.GetValue().lstrip().rstrip() 319 319 if background == "": 320 raise ValueError , "Need a background"320 raise ValueError("Need a background") 321 321 if check_float(self.background_tcl): 322 322 return float(background) 323 323 else: 324 324 msg = "Receive invalid value for background : %s" % (background) 325 raise ValueError , msg325 raise ValueError(msg) 326 326 327 327 def get_scale(self): … … 331 331 scale = self.scale_tcl.GetValue().lstrip().rstrip() 332 332 if scale == "": 333 raise ValueError , "Need a background"333 raise ValueError("Need a background") 334 334 if check_float(self.scale_tcl): 335 335 if float(scale) <= 0.0: … … 337 337 self.scale_tcl.Refresh() 338 338 msg = "Receive invalid value for scale: %s" % (scale) 339 raise ValueError , msg339 raise ValueError(msg) 340 340 return float(scale) 341 341 else: 342 raise ValueError , "Receive invalid value for scale : %s" % (scale)342 raise ValueError("Receive invalid value for scale : %s" % (scale)) 343 343 344 344 def get_contrast(self): … … 389 389 self.volume_err_tcl.SetValue(format_number(None)) 390 390 msg = "Error occurred computing volume " 391 msg += " fraction: %s" % sys.exc_ value391 msg += " fraction: %s" % sys.exc_info()[1] 392 392 wx.PostEvent(self.parent, StatusEvent(status=msg, 393 393 info="error", … … 409 409 self.surface_err_tcl.SetValue(format_number(None)) 410 410 msg = "Error occurred computing " 411 msg += "specific surface: %s" % sys.exc_ value411 msg += "specific surface: %s" % sys.exc_info()[1] 412 412 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 413 413 type="stop")) … … 431 431 self.invariant_total_err_tcl.SetValue(format_number(None)) 432 432 msg = "Error occurred computing invariant using" 433 msg += " extrapolation: %s" % sys.exc_ value433 msg += " extrapolation: %s" % sys.exc_info()[1] 434 434 wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 435 435 … … 454 454 self._manager.plot_theory(name="Low-Q extrapolation") 455 455 msg = "Error occurred computing low-Q " 456 msg += "invariant: %s" % sys.exc_ value456 msg += "invariant: %s" % sys.exc_info()[1] 457 457 wx.PostEvent(self.parent, 458 458 StatusEvent(status=msg, type="stop")) … … 462 462 self._manager.plot_theory(name="Low-Q extrapolation") 463 463 except: 464 logger.error(sys.exc_ value)464 logger.error(sys.exc_info()[1]) 465 465 466 466 def get_high_qstar(self, inv, high_q=False): … … 488 488 self._manager.plot_theory(name="High-Q extrapolation") 489 489 msg = "Error occurred computing high-Q " 490 msg += "invariant: %s" % sys.exc_ value490 msg += "invariant: %s" % sys.exc_info()[1] 491 491 wx.PostEvent(self.parent, StatusEvent(status=msg, 492 492 type="stop")) … … 496 496 self._manager.plot_theory(name="High-Q extrapolation") 497 497 except: 498 logger.error(sys.exc_ value)498 logger.error(sys.exc_info()[1]) 499 499 500 500 def get_qstar(self, inv): … … 625 625 scale = self.get_scale() 626 626 except: 627 msg = "Invariant Error: %s" % (sys.exc_ value)627 msg = "Invariant Error: %s" % (sys.exc_info()[1]) 628 628 wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 629 629 return … … 641 641 inv, npts_high = self.set_extrapolation_high(inv=inv, high_q=high_q) 642 642 except: 643 msg = "Error occurred computing invariant: %s" % sys.exc_ value643 msg = "Error occurred computing invariant: %s" % sys.exc_info()[1] 644 644 wx.PostEvent(self.parent, StatusEvent(status=msg, 645 645 info="warning", type="stop")) … … 652 652 self.get_qstar(inv=inv) 653 653 except: 654 msg = "Error occurred computing invariant: %s" % sys.exc_ value654 msg = "Error occurred computing invariant: %s" % sys.exc_info()[1] 655 655 wx.PostEvent(self.parent, StatusEvent(status=msg, 656 656 info="warning", … … 675 675 except: 676 676 msg = r_msg + "Error occurred computing invariant: %s" % \ 677 sys.exc_ value677 sys.exc_info()[1] 678 678 wx.PostEvent(self.parent, StatusEvent(status=msg, 679 679 info="error", … … 685 685 #compute surface and set value to txtcrtl 686 686 except: 687 msg = "Error occurred computing invariant: %s" % sys.exc_ value687 msg = "Error occurred computing invariant: %s" % sys.exc_info()[1] 688 688 wx.PostEvent(self.parent, StatusEvent(status=msg, 689 689 info="warning", … … 695 695 696 696 except: 697 msg = "Error occurred computing invariant: %s" % sys.exc_ value697 msg = "Error occurred computing invariant: %s" % sys.exc_info()[1] 698 698 wx.PostEvent(self.parent, StatusEvent(status=msg, 699 699 info="warning", … … 847 847 attr.SetValue(value) 848 848 except: 849 logger.error("Invariant state: %s", sys.exc_ value)849 logger.error("Invariant state: %s", sys.exc_info()[1]) 850 850 851 851 def get_bookmark_by_num(self, num=None): … … 864 864 _, _, current_state, comp_state = self.state.bookmark_list[int(num)] 865 865 except: 866 logger.error(sys.exc_ value)867 raise ValueError , "No such bookmark exists"866 logger.error(sys.exc_info()[1]) 867 raise ValueError("No such bookmark exists") 868 868 869 869 # set the parameters … … 959 959 self.state.clone_state() 960 960 except: 961 logger.error(sys.exc_ value)961 logger.error(sys.exc_info()[1]) 962 962 963 963 self._set_undo_flag(True) … … 1003 1003 del self.state.state_list[str(i)] 1004 1004 except: 1005 logger.error(sys.exc_ value)1005 logger.error(sys.exc_info()[1]) 1006 1006 # Enable the undo button if it was not 1007 1007 self._set_undo_flag(True) … … 1068 1068 del self.state.state_list[str(i)] 1069 1069 except: 1070 logger.error(sys.exc_ value)1070 logger.error(sys.exc_info()[1]) 1071 1071 1072 1072 # try to add new state of the text changes in the state_list … … 1083 1083 self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 1084 1084 except: 1085 logger.error(sys.exc_ value)1085 logger.error(sys.exc_info()[1]) 1086 1086 1087 1087 self._set_undo_flag(True) … … 1105 1105 self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 1106 1106 except: 1107 logger.error(sys.exc_ value)1107 logger.error(sys.exc_info()[1]) 1108 1108 1109 1109 def _get_input_list(self): … … 1114 1114 compute_num = self.state.saved_state['compute_num'] 1115 1115 # find values and put into the input list 1116 for key1, value1 in self.state.state_list[str(compute_num)].ite ritems():1117 for key, _ in self.state.input_list.ite ritems():1116 for key1, value1 in self.state.state_list[str(compute_num)].items(): 1117 for key, _ in self.state.input_list.items(): 1118 1118 if key == key1: 1119 1119 self.state.input_list[key] = value1
Note: See TracChangeset
for help on using the changeset viewer.