Ignore:
Timestamp:
09/01/16 07:55:20 (5 years ago)
Author:
mjuckes
Message:

updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/ptxt.py

    r526 r546  
    1010import string, re, collections, sys, uuid, utils_wb 
    1111import time, datetime, xlrd, codecs 
     12from utils_wb import uniCleanFunc 
    1213 
    1314sys.path.append('dreqPy' ) 
     
    4546 
    4647### tuble to define attributes of an item 
    47 nt__itematt = collections.namedtuple( 'itematt', ['name','type','title','clss','techn','uid','description','superclass','usage'] ) 
     48nt__itematt = collections.namedtuple( 'itematt', ['name','type','title','clss','techn','uid','description','superclass','usage','required'] ) 
    4849 
    4950vocab_elTmpl = '''<%(elementname)s label="%(label)s" uid="%(uid)s" title="%(title)s" id="%(id)s" itemLabelMode="%(ilm)s" level="%(sectLevel)s" maxOccurs="%(mxo)s" labUnique="%(labu)s" description="%(desc)s"> 
     
    5152</%(elementname)s> 
    5253''' 
    53 ial_elTmpl = '  <rowAttribute label="%(label)s"%(wrappedType)s%(wrappedTitle)s%(wrappedClass)s%(wrappedTechn)s%(wrappedDescription)s%(wrappedUid)s%(wrappedSuperclass)s%(wrappedUsage)s/>' 
     54ial_elTmpl = '  <rowAttribute label="%(label)s"%(wrappedType)s%(wrappedTitle)s%(wrappedClass)s%(wrappedTechn)s%(wrappedDescription)s%(wrappedUid)s%(wrappedSuperclass)s%(wrappedUsage)s%(wrappedReq)s/>' 
    5455 
    5556expl_Tmpl = '''<%(label)s label="%(label)s" uid="%(uid)s" useClass="vocab" title="%(title)s" id="%(id)s"> 
     
    9394###nt__itematt = collections.namedtuple( 'itematt', ['name','type','title','clss','techn'] ) 
    9495###nt__itematt = collections.namedtuple( 'itematt', ['name','type','title','clss','techn','uid','description','superclass'] ) 
    95      self.itematts = [  nt__itematt( 'label','xs:string','Record Label',None,None,None,None,None,None ), 
    96                         nt__itematt( 'title','xs:string','Record Title',None,None,None,None,None,None ) ] 
     96     self.itematts = [  nt__itematt( 'label','xs:string','Record Label',None,None,None,None,None,None,True ), 
     97                        nt__itematt( 'title','xs:string','Record Title',None,None,None,None,None,None,True ) ] 
    9798     self.counter = counter 
    9899 
     
    106107         wrappedTitle = wrap( ' title="%s"' , i.title ) 
    107108         wrappedType = wrap( ' type="%s"' , i.type ) 
     109         wrappedReq = wrap( ' required="%s"' , i.required ) 
    108110         if i.usage != '': 
    109111           wrappedUsage = wrap( ' usage="%s"' , i.usage ) 
     
    166168           elif i.type == "xs:integer": 
    167169             value = '25' 
     170           elif i.type in ["aa:st__integerList","aa:st__integerListMonInc"]: 
     171             value = '25 30' 
     172           elif i.type == "aa:st__floatList": 
     173             value = '5. 10.' 
    168174           elif i.type == "xs:float": 
    169175             value = '5.' 
     
    195201     if oo != None: 
    196202       try: 
    197          oo.write( self.vocab ) 
     203         oo.write( uniCleanFunc( self.vocab ) ) 
    198204       except: 
    199205         print 'Failed to write ...' 
     
    355361          this.attr( l) 
    356362        else: 
    357           while len(l) < 9: 
     363          while len(l) < 10: 
    358364            l.append( '' ) 
    359365          this.attr02( l) 
Note: See TracChangeset for help on using the changeset viewer.