Changeset 458


Ignore:
Timestamp:
28/10/15 22:26:33 (4 years ago)
Author:
mjuckes
Message:

updated content

Location:
CMIP6dreqbuild/trunk/src/framework
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/Makefile

    r449 r458  
    6060        echo "docs copied to /data/tmp/svn3/exarch/CMIP6dreq/trunk/docs" 
    6161        bash seddreq.sh annotated_20150731.xml dreq.xml dreqPy/dreq.py >  /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/dreq.py 
    62         bash seddreq02.sh "\.\.\/out" "\.\.\/docs" dreqPy/__init__.py > /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/__init__.py 
     62        bash seddreq02.sh "\.\.\/out" "\.\.\/docs" dreqPy/packageConfig.py > /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/packageConfig.py 
    6363        cp htmlTemplates.py dreqPy/scope.py dreqPy/example.py dreqPy/utilities.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy   
    64         cp dreqPy/dreqCmdl.py dreqPy/packageConfig.py dreqPy/simpleCheck.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 
     64        cp dreqPy/dreqCmdl.py dreqPy/__init__.py dreqPy/simpleCheck.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 
    6565        cp vocabDemo.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy     
     66        cp makeTables.py vrev.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/  
    6667        cp out/annotated_20150731.xml /data/tmp/svn3/exarch/CMIP6dreq/trunk/docs/dreq.xml 
    6768        ### cp LICENSE README.txt setup.py setup.cfg /data/tmp/svn3/exarch/CMIP6dreq/trunk/ 
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/dreq.py

    r442 r458  
    3131       _urlBase = '' 
    3232       _htmlStyle = {} 
     33       _linkAttrStyle = {} 
    3334 
    3435       def __init__(self,dict=None,xmlMiniDom=None,id='defaultId',etree=False): 
     
    6970           print ( 'Item <%s>: uninitialised' % self.sectionLabel ) 
    7071 
    71        def __href__(self,odir=""): 
     72       def __href__(self,odir="",label=None): 
    7273         igns =  {'','__unset__'} 
    7374         if 'description' in self.__dict__ and string.strip( self.description ) not in igns: 
     
    7778         else: 
    7879           ttl = self.label 
    79          return '<span title="%s"><a href="%s%s.html">%s</a></span>' % (ttl,odir,self.uid,self.uid) 
     80         if label == None: 
     81           label = self.uid 
     82         return '<span title="%s"><a href="%s%s.html">%s</a></span>' % (ttl,odir,self.uid,label) 
     83 
     84       def getHtmlLinkAttrStyle(self,a): 
     85         if a in self.__class__._linkAttrStyle: 
     86           return self.__class__._linkAttrStyle[a] 
     87         else: 
     88           return lambda a,targ: '<li>%s: [%s] %s [%s]</li>' % ( a, targ._h.label, targ.label, targ.__href__() ) 
    8089 
    8190       def __html__(self): 
     
    98107                     print ( a, self.__dict__[a], sect ) 
    99108                     raise 
    100                    m = '<li>%s: [%s] %s [%s]</li>' % ( a, targ._h.label, targ.label, targ.__href__() ) 
     109                   lst = self.getHtmlLinkAttrStyle(a) 
     110                   m = lst( a, targ ) 
     111                   ##m = '<li>%s: [%s] %s [%s]</li>' % ( a, targ._h.label, targ.label, targ.__href__() ) 
    101112               else: 
    102113                 m = '<li>%s: %s</li>' % ( a, self.__dict__[a] ) 
     
    473484    self.coll = self.c.get() 
    474485    self.inx = index(self.coll) 
     486    self.defaultItemLineStyle = lambda i: '<li>%s: %s</li>' % ( i.label, i.__href__(odir='../u/') ) 
     487    self.itemStyles = {} 
    475488## 
    476489## add index to Item base class .. so that it can be accessed by item instances 
     
    483496    dreqItemBase._htmlStyle['objective'] = {'getIrefs':['objectiveLink']} 
    484497    dreqItemBase._htmlStyle['requestLink'] = {'getIrefs':['objectiveLink','requestItem']} 
    485     dreqItemBase._htmlStyle['exptgroup'] = {'getIrefs':['experiment']} 
     498    dreqItemBase._htmlStyle['exptgroup'] = {'getIrefs':['__all__']} 
     499    dreqItemBase._htmlStyle['experiment'] = {'getIrefs':['__all__']} 
     500    dreqItemBase._htmlStyle['mip'] = {'getIrefs':['__all__']} 
    486501    dreqItemBase._htmlStyle['remarks'] = {'getIrefs':['__all__']} 
    487502##    dreqItemBase._htmlStyle['__general__'] = {'addRemarks':True} 
     
    492507<div id="top">CMIP6 Data Request</div> 
    493508%s</body></html>""" 
     509 
     510  def getHtmlItemStyle(self, sect): 
     511    if sect in self.itemStyles: 
     512      return self.itemStyles[sect] 
     513    return self.defaultItemLineStyle 
    494514 
    495515  def makeHtml(self,odir='./html'): 
     
    514534      msg = ['<h1>%s</h1>\n' % ttl, '<ul>',] 
    515535      msg.append( '<a href="../index.html">Home</a><br/>\n' ) 
     536      lst = self.getHtmlItemStyle(k) 
    516537      for i in self.coll[k].items: 
    517         m = '<li>%s: %s</li>' % ( i.label, i.__href__(odir='../u/') ) 
     538        ##m = '<li>%s: %s</li>' % ( i.label, i.__href__(odir='../u/') ) 
     539        m = lst( i ) 
    518540        msg.append( m ) 
    519541      msg.append( '</ul>' ) 
  • CMIP6dreqbuild/trunk/src/framework/scanDreq.py

    r442 r458  
    519519        this.removeChild(d) 
    520520    for k in mrefs.keys(): 
    521       print '>>>>>>>>>>> ',k 
    522521      if len(  mrefs[k] ) == 1: 
    523522        tid = mrefs[k][0][2] 
Note: See TracChangeset for help on using the changeset viewer.