示例#1
0
 def as_xml(cls, data):
     """
         Create XML from the current data.
         @param data: dictionary of reduction properties
     """
     data['timestamp'] = time.ctime();
             
     xml_file_path = os.path.join(scripts_location,'reduce.xml')
     xml = build_script(xml_file_path, cls, data)
     
     if is_xml_valid(xml):
         logger.debug("\n-------------------------\n"+xml+"\n-------------------------\n")
         return xml
     else:
         logger.error("XML is not valid!")
         return None
示例#2
0
 def as_xml(cls, data):
     """
         Create XML from the current data.
         @param data: dictionary of reduction properties
     """
     data['timestamp'] = time.ctime();
     dark_corr = data['dark_current_run'] and str(len(data['dark_current_run'])>0)
     data['dark_corr'] = dark_corr
     if data['beam_radius'] is None:
         data['beam_radius']=cls.base_fields['beam_radius'].initial
     
     xml_file_path = os.path.join(scripts_location,'reduce.xml')
     xml = build_script(xml_file_path, cls, data)
     
     if is_xml_valid(xml):
         logger.debug("\n-------------------------\n"+xml+"\n-------------------------\n")
         return xml
     else:
         logger.error("XML is not valid!")
         return None