Changeset c4f6851 in sasview for src/sas/perspectives/pr/inversion_state.py
- Timestamp:
- Mar 5, 2015 5:22:28 PM (10 years ago)
- 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- c1c14ba
- Parents:
- b40ad40
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/pr/inversion_state.py
rb9a5f0e rc4f6851 193 193 for item in in_list: 194 194 element = newdoc.createElement(item[0]) 195 cmd = "element.appendChild(newdoc.createTextNode(str(self.%s)))" 196 exec cmd % item[1] 195 element.appendChild(newdoc.createTextNode(str(getattr(self, item[1])))) 197 196 inputs.appendChild(element) 198 197 … … 203 202 for item in out_list: 204 203 element = newdoc.createElement(item[0]) 205 cmd = "element.appendChild(newdoc.createTextNode(str(self.%s)))" 206 exec cmd % item[1] 204 element.appendChild(newdoc.createTextNode(str(getattr(self, item[1])))) 207 205 outputs.appendChild(element) 208 206 … … 261 259 if input_field is not None: 262 260 try: 263 cmd = 'self.%s = float(input_field.text.strip())' 264 exec cmd % item[1] 261 setattr(self, item[1], float(input_field.text.strip())) 265 262 except: 266 exec 'self.%s = None' % item[1]263 setattr(self, item[1], None) 267 264 input_field = get_content('ns:estimate_bck', entry) 268 265 if input_field is not None: … … 280 277 if input_field is not None: 281 278 try: 282 cmd = 'self.%s = float(input_field.text.strip())' 283 exec cmd % item[1] 279 setattr(self, item[1], float(input_field.text.strip())) 284 280 except: 285 exec 'self.%s = None' % item[1]281 setattr(self, item[1], None) 286 282 287 283 # Look for coefficients
Note: See TracChangeset
for help on using the changeset viewer.