• Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 102 for Xml/Validator/Backend/OmeValidator.py

Show
Ignore:
Timestamp:
09/26/07 09:35:33 (16 months ago)
Author:
andrew
Message:

Now checks serial number.

Files:
1 modified

  • Xml/Validator/Backend/OmeValidator.py (modified) (8 diffs)

Legend:

Unmodified
Added
Removed
  • Xml/Validator/Backend/OmeValidator.py

    r93 r102  
    3737        return inFilename 
    3838 
    39 # Try to load Image for XML Schema Vlaidation Support 
     39# Try to load Image for Tiff Support 
    4040haveTiffSupport = True 
    4141try: 
    … …  
    4545        haveTiffSupport = False 
    4646 
    47 # Try to load lxml for XML Schema Vlaidation Support 
     47# Try to load lxml for XML Schema Validation Support 
    4848haveXsdSupport = True 
    4949try: 
    … …  
    137137        """ 
    138138        theNamespace = None 
     139         
     140        """ 
     141        The namespace define in the OME element of the OME-XML document 
     142        """ 
     143        thePrefix = None 
    139144         
    140145        """ 
    … …  
    240245                 
    241246                # 
    242                 print self.theDom.toprettyxml() 
     247                #print self.theDom.toprettyxml() 
    243248                 
    244249                # building the document tree from the input xml 
    … …  
    523528                                # a prefex is being used 
    524529                                self.thePrefix = name[:-4] 
    525                                 print "Prefix : %s" % self.thePrefix 
    526530                                try: 
    527531                                        self.theNamespace = attribs.getValue("xmlns" + ':' + self.thePrefix) 
    … …  
    641645                        self.omePlanesCount = self.omePlanesCount + 1 
    642646                 
     647                if name[-12:] == "ManufactSpec": 
     648                        try: 
     649                                # look for the serial number 
     650                                theSerial = int(attribs.getValue("SerialNumber")) 
     651                        except KeyValue: 
     652                                pass 
     653                        if theSerial is None or len(theSerial) == 0: 
     654                                self.warningList.append(ParseMessage(None, None, None, "OME","", "Missing or empty SerialNumber in ManufactSpec")) 
     655                 
    643656                self.domify(name, attribs) 
    644657                         
    … …  
    688701                                # a prefex is being used 
    689702                                self.thePrefix = name[:-4] 
    690                                 print "Prefix : %s" % self.thePrefix 
    691703                                try: 
    692704                                        # pull the namespace for prefix out of the OME element 
    … …  
    720732        for aFilename in ["samples/4d2wOME.tif", "samples/4d2wOME-fixed.tif", 
    721733                "samples/4d2wOME-fixed-updated.tif", "samples/blank.tif", 
    722                 "samples/ome.xsd"]: 
     734                "samples/ome.xsd", "samples/4d2wOME-EdExtra.tif"]: 
    723735                print "============ XML file %s ============ " % aFilename 
    724736                print XmlReport.validateTiff(aFilename) 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/