Changeset 926ece5 in sasview


Ignore:
Timestamp:
Sep 18, 2018 9:36:59 AM (3 months ago)
Author:
krzywon
Branches:
ticket-1111, unittest-saveload
Children:
5218180
Parents:
f4e2f22
Message:

Py3 compatibility and code cleanup.

Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    rfeec1cb r926ece5  
    601601            iter(iterable) 
    602602            if (not isinstance(iterable, np.ndarray) and not isinstance( 
    603                     iterable, list)) or (isinstance(iterable, str) or 
    604                                          isinstance(iterable, unicode)): 
     603                    iterable, list)) or (isinstance(iterable, basestring)): 
    605604                raise TypeError 
    606605        except TypeError: 
     
    633632                elif q_vals.attrs.get("uncertainty") is not None: 
    634633                    self.q_uncertainties = q_vals.attrs.get("uncertainty") 
    635                 if isinstance(self.q_uncertainties, str): 
     634                if isinstance(self.q_uncertainties, basestring): 
    636635                    self.q_uncertainties = self.q_uncertainties.split(",") 
    637636                if q_vals.attrs.get("resolutions") is not None: 
    638637                    self.q_resolutions = q_vals.attrs.get("resolutions") 
    639                 if isinstance(self.q_resolutions, (str, unicode)): 
     638                if isinstance(self.q_resolutions, basestring): 
    640639                    self.q_resolutions = self.q_resolutions.split(",") 
    641640        if self.i_name in keys: 
  • src/sas/sasgui/guiframe/gui_manager.py

    rfeec1cb r926ece5  
    24252425                    "CanSAS 1D files (*.xml)|*.xml|"\ 
    24262426                     "NXcanSAS files (*.h5)|*.h5|" 
    2427         options = {0: ".txt", 
    2428                    1: ".xml", 
    2429                    2: ".h5"} 
     2427        options = [".txt", ".xml",".h5"] 
    24302428        dlg = wx.FileDialog(self, "Choose a file", 
    24312429                            self._default_save_location, 
     
    25302528            text += 'dY_min = %s:  dY_max = %s\n' % (min(data.dy), max(data.dy)) 
    25312529        text += '\nData Points:\n' 
    2532         text += "<index> \t<X> \t<Y> \t<dY> \t<dX" 
    2533         if data.dxl is not None and data.dxw is not None: 
    2534                 text += "l> \t<dxw" 
    2535         text += ">\n" 
     2530        text += "<index> \t<X> \t<Y> \t<dY> " 
     2531        text += "\t<dX>\n" if(data.dxl is not None and 
     2532                              data.dxw is not None) else "\t<dXl> \t<dXw>\n" 
    25362533        for index in range(len(data.x)): 
    25372534            if data.dy is not None and len(data.dy) > index: 
Note: See TracChangeset for help on using the changeset viewer.