Changeset 458
- Timestamp:
- 28/10/15 22:26:33 (5 years ago)
- Location:
- CMIP6dreqbuild/trunk/src/framework
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/src/framework/Makefile
r449 r458 60 60 echo "docs copied to /data/tmp/svn3/exarch/CMIP6dreq/trunk/docs" 61 61 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__.py62 bash seddreq02.sh "\.\.\/out" "\.\.\/docs" dreqPy/packageConfig.py > /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/packageConfig.py 63 63 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/dreqPy64 cp dreqPy/dreqCmdl.py dreqPy/__init__.py dreqPy/simpleCheck.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 65 65 cp vocabDemo.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 66 cp makeTables.py vrev.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/ 66 67 cp out/annotated_20150731.xml /data/tmp/svn3/exarch/CMIP6dreq/trunk/docs/dreq.xml 67 68 ### cp LICENSE README.txt setup.py setup.cfg /data/tmp/svn3/exarch/CMIP6dreq/trunk/ -
CMIP6dreqbuild/trunk/src/framework/dreqPy/dreq.py
r442 r458 31 31 _urlBase = '' 32 32 _htmlStyle = {} 33 _linkAttrStyle = {} 33 34 34 35 def __init__(self,dict=None,xmlMiniDom=None,id='defaultId',etree=False): … … 69 70 print ( 'Item <%s>: uninitialised' % self.sectionLabel ) 70 71 71 def __href__(self,odir="" ):72 def __href__(self,odir="",label=None): 72 73 igns = {'','__unset__'} 73 74 if 'description' in self.__dict__ and string.strip( self.description ) not in igns: … … 77 78 else: 78 79 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__() ) 80 89 81 90 def __html__(self): … … 98 107 print ( a, self.__dict__[a], sect ) 99 108 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__() ) 101 112 else: 102 113 m = '<li>%s: %s</li>' % ( a, self.__dict__[a] ) … … 473 484 self.coll = self.c.get() 474 485 self.inx = index(self.coll) 486 self.defaultItemLineStyle = lambda i: '<li>%s: %s</li>' % ( i.label, i.__href__(odir='../u/') ) 487 self.itemStyles = {} 475 488 ## 476 489 ## add index to Item base class .. so that it can be accessed by item instances … … 483 496 dreqItemBase._htmlStyle['objective'] = {'getIrefs':['objectiveLink']} 484 497 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__']} 486 501 dreqItemBase._htmlStyle['remarks'] = {'getIrefs':['__all__']} 487 502 ## dreqItemBase._htmlStyle['__general__'] = {'addRemarks':True} … … 492 507 <div id="top">CMIP6 Data Request</div> 493 508 %s</body></html>""" 509 510 def getHtmlItemStyle(self, sect): 511 if sect in self.itemStyles: 512 return self.itemStyles[sect] 513 return self.defaultItemLineStyle 494 514 495 515 def makeHtml(self,odir='./html'): … … 514 534 msg = ['<h1>%s</h1>\n' % ttl, '<ul>',] 515 535 msg.append( '<a href="../index.html">Home</a><br/>\n' ) 536 lst = self.getHtmlItemStyle(k) 516 537 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 ) 518 540 msg.append( m ) 519 541 msg.append( '</ul>' ) -
CMIP6dreqbuild/trunk/src/framework/scanDreq.py
r442 r458 519 519 this.removeChild(d) 520 520 for k in mrefs.keys(): 521 print '>>>>>>>>>>> ',k522 521 if len( mrefs[k] ) == 1: 523 522 tid = mrefs[k][0][2]
Note: See TracChangeset
for help on using the changeset viewer.