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

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 193 for Xml/xsd-fu/trunk/xsd-fu

Show
Ignore:
Timestamp:
07/24/08 13:11:11 (6 months ago)
Author:
andrew
Message:

Added a new main based on the debugMain that will genereate docs in wiki format.

Files:
1 modified

  • Xml/xsd-fu/trunk/xsd-fu (modified) (1 diff)

Legend:

Unmodified
Added
Removed
  • Xml/xsd-fu/trunk/xsd-fu

    r179 r193  
    118118                        print template.generate(fu=fu, klass=obj).render() 
    119119 
     120def docGenMain(): 
     121        """ 
     122        Documentation main() that does not parse the command line and spits 
     123        generated wiki formatted docs to STDOUT. 
     124        Added by Andrew Patterson (July 2008) to generate content for  
     125        the ArityOfSchema page on http://ome-xml.org 
     126        """ 
     127        outputDirectory = None 
     128        package = DEFAULT_PACKAGE 
     129        namespace = "xsd:" 
     130         
     131        for theSchemas in [ 
     132        ["OME","../../Working/ome-roi-sa.xsd"],  
     133        ["SPW","../../Working/SPW.xsd"], 
     134        ["CA","../../Working/CA.xsd"], 
     135        ["CLI","../../Working/CLI.xsd"], 
     136        ["AnalysisChain","../../Working/AnalysisChain.xsd"], 
     137        ["AnalysisModule","../../Working/AnalysisModule.xsd"], 
     138        ["BinaryFile","../../Working/BinaryFile.xsd"], 
     139        ["DataHistory","../../Working/DataHistory.xsd"], 
     140        ["MLI","../../Working/MLI.xsd"], 
     141        ["SA","../../Working/SA.xsd"], 
     142        ["STD","../../Working/STD.xsd"] 
     143        ]: 
     144                prefix = theSchemas[0] + ":" 
     145                model = parseXmlSchema(theSchemas[1], namespace) 
     146                fu = TemplateInfo(outputDirectory, package) 
     147                template = NewTextTemplate(open(CLASS_TEMPLATE).read()) 
     148                print " == `%s` ==" % (prefix) 
     149                for obj in model.objects.values(): 
     150                        print " === %s%s ===" % (prefix, obj.name) 
     151                        print " * %s%s(base = `%s`, type = `%s`)" % (prefix, obj.name, obj.base, obj.type) 
     152                        for prop in obj.properties.values(): 
     153                                print "   * %s%s:%s( `%s` ) ![%d:%d]" % \ 
     154                                    (prefix, obj.name, prop.name, prop.type, prop.minOccurs, prop.maxOccurs) 
     155                        print "\n" 
     156 
    120157if __name__ == '__main__': 
    121158#       debugMain() 
     159#       docGenMain() 
    122160        main() 
    123161 

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/