Changeset 35b556d in sasview


Ignore:
Timestamp:
May 26, 2010 4:41:25 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
c6a48c27
Parents:
e9b12eaf
Message:

working on save state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/pagestate.py

    re9b12eaf r35b556d  
    1414import logging 
    1515 
     16import xml.dom.minidom 
    1617from xml.dom.minidom import parse 
    1718from lxml import etree 
     
    2021from DataLoader.readers.cansas_reader import Reader as CansasReader 
    2122from DataLoader.readers.cansas_reader import get_content, write_node 
     23from DataLoader.data_info import Data2D 
    2224 
    2325#Information to read/write state as xml 
     
    7678list_of_data2d_values = [["qx_data","qx_data"], 
    7779                         ["qy_data","qy_data"], 
    78                          ["qdx_data","qdx_data"], 
    79                          ["qdy_data","qdy_data"], 
     80                         ["dqx_data","dqx_data"], 
     81                         ["dqy_data","dqy_data"], 
    8082                         ["data","data"], 
    8183                         ["q_data","q_data"], 
     
    578580        for item in list_of_data2d_values: 
    579581            element = doc.createElement(item[0]) 
    580             exec "temp_list = self.%s"%item[1] 
    581             for value in temp_list: 
    582                 exec "element.appendChild(doc.createTextNode(str(%s)))" % value 
     582            exec "temp_list = datainfo.%s"%item[1] 
     583            if temp_list is None or len(temp_list)== 0: 
     584                exec "element.appendChild(doc.createTextNode(str(%s)))"%temp_list 
     585            else: 
     586                for value in temp_list: 
     587                    exec "element.appendChild(doc.createTextNode(str(%s)))"%value 
    583588            entry_node.appendChild(element) 
    584589       
Note: See TracChangeset for help on using the changeset viewer.