Changeset 574adc7 in sasview for src/sas/sascalc/fit/pagestate.py


Ignore:
Timestamp:
Sep 22, 2017 4:01:32 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
34d7b35
Parents:
9706d88
Message:

convert sascalc to python 2/3 syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/fit/pagestate.py

    r277257f r574adc7  
    313313 
    314314        if len(self.disp_obj_dict) > 0: 
    315             for k, v in self.disp_obj_dict.iteritems(): 
     315            for k, v in self.disp_obj_dict.items(): 
    316316                obj.disp_obj_dict[k] = v 
    317317        if len(self.disp_cb_dict) > 0: 
    318             for k, v in self.disp_cb_dict.iteritems(): 
     318            for k, v in self.disp_cb_dict.items(): 
    319319                obj.disp_cb_dict[k] = v 
    320320        if len(self.values) > 0: 
    321             for k, v in self.values.iteritems(): 
     321            for k, v in self.values.items(): 
    322322                obj.values[k] = v 
    323323        if len(self.weights) > 0: 
    324             for k, v in self.weights.iteritems(): 
     324            for k, v in self.weights.items(): 
    325325                obj.weights[k] = v 
    326326        obj.enable_smearer = copy.deepcopy(self.enable_smearer) 
     
    347347        obj.version = copy.deepcopy(self.version) 
    348348 
    349         for name, state in self.saved_states.iteritems(): 
     349        for name, state in self.saved_states.items(): 
    350350            copy_name = copy.deepcopy(name) 
    351351            copy_state = state.clone() 
     
    430430        """ 
    431431        p_map = [] 
    432         for name, info in params.iteritems(): 
     432        for name, info in params.items(): 
    433433            if ".fittable" in name or ".std" in name or ".upper" in name or \ 
    434434                            ".lower" in name or ".units" in name: 
     
    475475            formfactor, str_params = convert.convert_model( 
    476476                self.formfactorcombobox, str_pars, False, self.version) 
    477             for key, value in str_params.iteritems(): 
     477            for key, value in str_params.items(): 
    478478                params[key] = value 
    479479 
     
    835835            element = newdoc.createElement(item[0]) 
    836836            value_list = getattr(self, item[1]) 
    837             for key, value in value_list.iteritems(): 
     837            for key, value in value_list.items(): 
    838838                sub_element = newdoc.createElement(key) 
    839839                sub_element.setAttribute('name', str(key)) 
     
    848848            element = newdoc.createElement(tagname) 
    849849            value_list = getattr(self, varname) 
    850             for key, value in value_list.iteritems(): 
     850            for key, value in value_list.items(): 
    851851                sub_element = newdoc.createElement(key) 
    852852                sub_element.setAttribute('name', str(key)) 
     
    950950            msg = "PageState no longer supports non-CanSAS" 
    951951            msg += " format for fitting files" 
    952             raise RuntimeError, msg 
     952            raise RuntimeError(msg) 
    953953 
    954954        if node.get('version'): 
     
    12411241            else: 
    12421242                self.call_back(format=ext) 
    1243                 raise RuntimeError, "%s is not a file" % path 
     1243                raise RuntimeError("%s is not a file" % path) 
    12441244 
    12451245            # Return output consistent with the loader's api 
Note: See TracChangeset for help on using the changeset viewer.