Changeset ab9984e in sasview for src/sas


Ignore:
Timestamp:
Dec 14, 2016 2:29:00 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:
abc5e70
Parents:
debf5c3
Message:

Pylint fix

File:
1 edited

Legend:

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

    rdebf5c3 rab9984e  
     1""" 
     2Slit Size Calculator Panel 
     3""" 
     4import os 
     5import sys 
     6 
    17from PyQt4 import QtGui 
    28from PyQt4 import QtCore 
     
    511from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 
    612 
    7 import os 
    8 import sys 
    913 
    1014class SlitSizeCalculator(QtGui.QDialog, Ui_SlitSizeCalculator): 
     
    6872        # But only with Qt built-in dialog (non-platform native) 
    6973        path = QtGui.QFileDialog.getOpenFileName(self, "Choose a file", "", 
    70                 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 
    71                 QtGui.QFileDialog.DontUseNativeDialog) 
     74                                                 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 
     75                                                 QtGui.QFileDialog.DontUseNativeDialog) 
    7276 
    7377        if path is None: 
     
    100104        #compute the slit size 
    101105        try: 
    102              x = data.x 
    103              y = data.y 
    104              if x == [] or x is None or y == [] or y is None: 
    105                  msg = "The current data is empty please check x and y" 
    106                  raise ValueError, msg 
    107              slit_length_calculator = SlitlengthCalculator() 
    108              slit_length_calculator.set_data(x=x, y=y) 
    109              slit_length = slit_length_calculator.calculate_slit_length() 
     106            xdata = data.x 
     107            ydata = data.y 
     108            if xdata == [] or xdata is None or ydata == [] or ydata is None: 
     109                msg = "The current data is empty please check x and y" 
     110                raise ValueError, msg 
     111            slit_length_calculator = SlitlengthCalculator() 
     112            slit_length_calculator.set_data(x=xdata, y=ydata) 
     113            slit_length = slit_length_calculator.calculate_slit_length() 
    110114        except: 
    111              msg = "Slit Size Calculator: %s" % (sys.exc_value) 
    112              raise RuntimeError, msg 
     115            msg = "Slit Size Calculator: %s" % (sys.exc_value) 
     116            raise RuntimeError, msg 
    113117 
    114118        slit_length_str = "{:.5f}".format(slit_length) 
Note: See TracChangeset for help on using the changeset viewer.