Changeset 1234 for CMIP6dreqbuild


Ignore:
Timestamp:
09/07/18 10:17:41 (17 months ago)
Author:
mjuckes
Message:

defaults to non-use of lxml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/dreq.py

    r1230 r1234  
    484484  """Read in a vocabulary collection configuration document and a vocabulary document""" 
    485485 
    486   def __init__(self, configdoc='out/dreqDefn.xml', thisdoc='../workbook/trial_20150724.xml', manifest=None, useShelve=False, strings=False,configOnly=False): 
     486  def __init__(self, configdoc='out/dreqDefn.xml', thisdoc='../workbook/trial_20150724.xml', manifest=None, useShelve=False, strings=False,configOnly=False,lxml=False): 
    487487    self.rc = rechecks() 
    488488    self.lu = lutilsC() 
     
    506506    self.docs = {} 
    507507    self.version = None 
     508    self.useLxml = lxml 
    508509 
    509510    if manifest != None: 
     
    553554    if not self.configOnly: 
    554555      if self.etree: 
    555         uselxml = True 
    556         if uselxml: 
     556        if self.useLxml: 
    557557          import lxml 
    558558          import lxml.etree as et 
     
    564564          ## absence of registration means module cannot write data exactly as read. 
    565565          ## 
    566           if uselxml: 
     566          if self.useLxml: 
    567567            ##et.register_namespace('', "urn:w3id.org:cmip6.dreq.dreq:a") 
    568568            et.register_namespace('pav', "http://purl.org/pav/2.3") 
     
    572572 
    573573        if not self.strings: 
    574           if uselxml: 
     574          if self.useLxml: 
    575575            ##parser = etree.XMLParser( remove_blank_text=True ) 
    576576            ##self.contentDoc = et.parse( self.vsamp, parser  ) 
     
    938938  useShelve: flag to specify whether to retrieve data from cache (not implemented) 
    939939  htmlStyles: dictionary of styling directives which influence structure of html page generates by the "makeHtml" method 
     940  lxml [False]: if true, use python lxml package for elementree module instead of the default xml package. 
    940941""" 
    941942 
    942   def __init__(self,dreqXML=None, configdoc=None, useShelve=False, htmlStyles=None, strings=False, manifest=defaultManifestPath , configOnly=False): 
     943  def __init__(self,dreqXML=None, configdoc=None, useShelve=False, htmlStyles=None, strings=False, manifest=defaultManifestPath , configOnly=False,lxml=False): 
    943944    if manifest == None: 
    944945      if dreqXML == None: 
     
    946947      if configdoc==None: 
    947948       configdoc=defaultConfigPath 
    948     self.c = config( thisdoc=dreqXML, configdoc=configdoc, useShelve=useShelve,strings=strings,manifest=manifest,configOnly=configOnly) 
     949    self.c = config( thisdoc=dreqXML, configdoc=configdoc, useShelve=useShelve,strings=strings,manifest=manifest,configOnly=configOnly,lxml=lxml) 
    949950    self.coll = self.c.coll 
    950951    self.version = self.c.version 
Note: See TracChangeset for help on using the changeset viewer.