Changeset 886d2f2c in sasview for src


Ignore:
Timestamp:
Dec 14, 2016 5:41:30 AM (8 years ago)
Author:
wojciech
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:
0ba0774
Parents:
abc5e70
Message:

A few fixes after code review

Location:
src/sas/qtgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/SlitSizeCalculator.py

    rab9984e r886d2f2c  
    8989        self.close() 
    9090 
     91    def clearResults(self): 
     92        """ 
     93        Clear the content of output LineEdits 
     94        """ 
     95        self.slit_length_out.setText("ERROR!") 
     96        self.unit_out.clear() 
     97 
    9198    def calculateSlitSize(self, data=None): 
    9299        """ 
     
    95102 
    96103        if data is None: 
     104            self.clearResults() 
    97105            msg = "ERROR: Data hasn't been loaded correctly" 
    98106            raise RuntimeError, msg 
    99107 
    100108        if data.__class__.__name__ == 'Data2D': 
     109            self.clearResults() 
    101110            msg = "Slit Length cannot be computed for 2D Data" 
    102             raise Exception, msg 
     111            raise RuntimeError, msg 
    103112 
    104113        #compute the slit size 
     
    113122            slit_length = slit_length_calculator.calculate_slit_length() 
    114123        except: 
     124            self.clearResults() 
    115125            msg = "Slit Size Calculator: %s" % (sys.exc_value) 
    116126            raise RuntimeError, msg 
  • src/sas/qtgui/UnitTesting/SlitSizeCalculatorTest.py

    rdebf5c3 r886d2f2c  
    8383        loader = Loader() 
    8484        data = loader.load(filename) 
    85         self.assertRaisesRegexp(Exception, 
     85        self.assertRaisesRegexp(RuntimeError, 
    8686                                "Slit Length cannot be computed for 2D Data", 
    8787                                self.widget.calculateSlitSize, data) 
Note: See TracChangeset for help on using the changeset viewer.