• 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

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

Now checks serial number.

Location:
Xml/Validator/Backend
Files:
2 modified

  • OmeValidator.py (modified) (8 diffs)
  • ValidatorBackend.tmproj (modified) (6 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) 
  • Xml/Validator/Backend/ValidatorBackend.tmproj

    r96 r102  
    33<plist version="1.0"> 
    44<dict> 
    5         <key>currentDocument</key> 
    6         <string>mateTiff.py</string> 
    75        <key>documents</key> 
    86        <array> 
    97                <dict> 
    108                        <key>filename</key> 
     9                        <string>isValidOME.py</string> 
     10                        <key>lastUsed</key> 
     11                        <date>2007-09-24T11:42:01Z</date> 
     12                </dict> 
     13                <dict> 
     14                        <key>filename</key> 
    1115                        <string>mateTiff.py</string> 
    1216                        <key>lastUsed</key> 
    13                         <date>2007-09-19T13:54:42Z</date> 
    14                         <key>selected</key> 
    15                         <true/> 
     17                        <date>2007-09-24T11:41:59Z</date> 
    1618                </dict> 
    1719                <dict> 
    … …  
    1921                        <string>RunAndCheck.py</string> 
    2022                        <key>lastUsed</key> 
    21                         <date>2007-09-19T09:21:35Z</date> 
     23                        <date>2007-09-24T11:42:02Z</date> 
    2224                </dict> 
    2325                <dict> 
    … …  
    2527                        <string>OmeValidator.py</string> 
    2628                        <key>lastUsed</key> 
    27                         <date>2007-09-19T13:54:42Z</date> 
     29                        <date>2007-09-24T11:42:02Z</date> 
    2830                </dict> 
    2931                <dict> 
    … …  
    3133                        <string>ome-fc-tiff.xsd</string> 
    3234                        <key>lastUsed</key> 
    33                         <date>2007-09-19T09:23:40Z</date> 
     35                        <date>2007-09-24T11:42:03Z</date> 
     36                        <key>selected</key> 
     37                        <true/> 
    3438                </dict> 
    3539                <dict> 
    … …  
    5660        <key>metaData</key> 
    5761        <dict> 
    58                 <key>OmeValidator.py</key> 
    59                 <dict> 
    60                         <key>caret</key> 
    61                         <dict> 
    62                                 <key>column</key> 
    63                                 <integer>40</integer> 
    64                                 <key>line</key> 
    65                                 <integer>224</integer> 
    66                         </dict> 
    67                         <key>firstVisibleColumn</key> 
    68                         <integer>0</integer> 
    69                         <key>firstVisibleLine</key> 
    70                         <integer>103</integer> 
    71                 </dict> 
    72                 <key>RunAndCheck.py</key> 
    73                 <dict> 
    74                         <key>caret</key> 
    75                         <dict> 
    76                                 <key>column</key> 
    77                                 <integer>1</integer> 
    78                                 <key>line</key> 
    79                                 <integer>29</integer> 
    80                         </dict> 
    81                         <key>firstVisibleColumn</key> 
    82                         <integer>0</integer> 
    83                         <key>firstVisibleLine</key> 
    84                         <integer>0</integer> 
    85                 </dict> 
    86                 <key>mateTiff.py</key> 
    87                 <dict> 
    88                         <key>caret</key> 
    89                         <dict> 
    90                                 <key>column</key> 
    91                                 <integer>20</integer> 
    92                                 <key>line</key> 
    93                                 <integer>44</integer> 
    94                         </dict> 
    95                         <key>firstVisibleColumn</key> 
    96                         <integer>0</integer> 
    97                         <key>firstVisibleLine</key> 
    98                         <integer>38</integer> 
    99                 </dict> 
    100                 <key>ome-fc-tiff.xsd</key> 
    101                 <dict> 
    102                         <key>caret</key> 
    103                         <dict> 
    104                                 <key>column</key> 
    105                                 <integer>16</integer> 
    106                                 <key>line</key> 
    107                                 <integer>9</integer> 
    108                         </dict> 
    109                         <key>firstVisibleColumn</key> 
    110                         <integer>0</integer> 
    111                         <key>firstVisibleLine</key> 
    112                         <integer>0</integer> 
    113                 </dict> 
    11462                <key>samples/completesamplenoenc.xml</key> 
    11563                <dict> 
    … …  
    185133                </dict> 
    186134        </dict> 
    187         <key>openDocuments</key> 
    188         <array> 
    189                 <string>mateTiff.py</string> 
    190                 <string>OmeValidator.py</string> 
    191                 <string>RunAndCheck.py</string> 
    192                 <string>ome-fc-tiff.xsd</string> 
    193         </array> 
    194135        <key>showFileHierarchyDrawer</key> 
    195136        <true/> 
    196137        <key>windowFrame</key> 
    197         <string>{{580, 61}, {788, 840}}</string> 
     138        <string>{{392, 104}, {857, 983}}</string> 
    198139</dict> 
    199140</plist> 

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/