Changeset 291


Ignore:
Timestamp:
Mar 16, 2013 12:57:34 PM (6 years ago)
Author:
prjemian
Message:

another example from ISIS
allow python code to read either v1.0 or v1.1 data files

Location:
1dwg/branches/v1.1
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • 1dwg/branches/v1.1/python/cansas1d_example.py

    • Property svn:eol-style set to native
    • Property svn:executable set to *
    • Property svn:keywords set to Author Date Id Revision URL Header
    r289 r291  
    66 
    77########### SVN repository information ################### 
    8 # $Date: 2011-08-05 12:25:16 -0500 (Fri, 05 Aug 2011) $ 
    9 # $Author: jemian $ 
    10 # $Revision: 603 $ 
    11 # $URL: https://subversion.xray.aps.anl.gov/bcdaext/epicsdf/src/epicsdf.py $ 
    12 # $Id: epicsdf.py 603 2011-08-05 17:25:16Z jemian $ 
     8# $Date$ 
     9# $Author$ 
     10# $Revision$ 
     11# $URL$ 
     12# $Id$ 
    1313########### SVN repository information ################### 
    1414 
     
    7272    # read in the XML file 
    7373    sasxml = gnosis.xml.objectify.XML_Objectify(xmlFile).make_instance() 
    74     if sasxml.xmlns != 'urn:cansas1d:1.1': 
     74    # support reading v1.0 and v1.1 data files 
     75    # v1.1 schema is backwards compatible, mostly 
     76    if sasxml.xmlns not in ('urn:cansas1d:1.1', 'cansas1d/1.0'): 
    7577        print "Not cansas1d:1.1 file (found: %s)" % sasxml.xmlns 
    7678        return 
    7779    print 'namespace:', sasxml.xmlns 
    78     if sasxml.version != '1.1': 
     80    if sasxml.version not in ('1.1', '1.0'): 
    7981        print "Not v1.1 file (found: %s)" % sasxml.version 
    8082        return 
Note: See TracChangeset for help on using the changeset viewer.