Ignore:
Timestamp:
Oct 26, 2017 3:13:05 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
895e7359
Parents:
def64a0
Message:

Initial changes to make SasView? run with python3

File:
1 edited

Legend:

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

    • Property mode changed from 100644 to 100755
    rf4a1433 rb0b09b9  
    1111import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1212 
    13 from UI.SlitSizeCalculator import Ui_SlitSizeCalculator 
     13from .UI.SlitSizeCalculator import Ui_SlitSizeCalculator 
    1414from sas.sascalc.dataloader.loader import Loader 
    1515from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 
     
    7676        # But only with Qt built-in dialog (non-platform native) 
    7777        path = QtGui.QFileDialog.getOpenFileName(self, "Choose a file", "", 
    78                                                  "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 
     78                                                 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", 
    7979                                                 QtGui.QFileDialog.DontUseNativeDialog) 
    8080 
     
    107107            self.clearResults() 
    108108            msg = "ERROR: Data hasn't been loaded correctly" 
    109             raise RuntimeError, msg 
     109            raise RuntimeError(msg) 
    110110 
    111111        if data.__class__.__name__ == 'Data2D': 
    112112            self.clearResults() 
    113113            msg = "Slit Length cannot be computed for 2D Data" 
    114             raise RuntimeError, msg 
     114            raise RuntimeError(msg) 
    115115 
    116116        #compute the slit size 
     
    120120            if xdata == [] or xdata is None or ydata == [] or ydata is None: 
    121121                msg = "The current data is empty please check x and y" 
    122                 raise ValueError, msg 
     122                raise ValueError(msg) 
    123123            slit_length_calculator = SlitlengthCalculator() 
    124124            slit_length_calculator.set_data(x=xdata, y=ydata) 
     
    126126        except: 
    127127            self.clearResults() 
    128             msg = "Slit Size Calculator: %s" % (sys.exc_value) 
    129             raise RuntimeError, msg 
     128            msg = "Slit Size Calculator: %s" % (sys.exc_info()[1]) 
     129            raise RuntimeError(msg) 
    130130 
    131131        slit_length_str = "{:.5f}".format(slit_length) 
Note: See TracChangeset for help on using the changeset viewer.