Changeset 712
- Timestamp:
- 09/08/16 17:00:21 (5 years ago)
- Location:
- CMIP6dreqbuild/trunk/src/framework/dreqPy
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/src/framework/dreqPy/dreq.py
r711 r712 20 20 pythonPre27 = sys.version_info[1] < 7 21 21 22 charmeTempl = """<span title="Using the CHARMe annotation system">Comment on this page:<a href="%s/%s/%s.html" class="charme-metadata-document"></a></span> 23 24 <span> 25 <div id="charme-placeholder"></div> 26 </span> 27 <br/> 28 <!-- the charme-placeholder-all-targets appears to be required, but can be hidden ... --> 29 <span style="display: None;"> 30 <div id="charme-placeholder-all-targets"></div> 31 </span> 32 """ 33 22 34 jsh='''<link type="text/css" href="/css/jquery-ui-1.8.16.custom.css" rel="Stylesheet" /> 23 35 <script src="/js/2013/jquery.min.js" type="text/javascript"></script> … … 27 39 <link type="text/css" href="/css/dreq.css" rel="Stylesheet" /> 28 40 ''' 41 42 def dref(i,x): 43 return i._inx.uid[i.__dict__[x]] 29 44 30 45 blockSchemaFile = '%s/%s' % (DOC_DIR, 'BlockSchema.csv' ) … … 135 150 _htmlStyle = {} 136 151 _linkAttrStyle = {} 152 __charmeEnable__ = {} 137 153 138 154 def __init__(self,idict=None,xmlMiniDom=None,id='defaultId',etree=False): … … 232 248 sect = self._h.label 233 249 msg.append( '<h1>%s: [%s] %s</h1>' % (self._h.title,self.label,self.title) ) 250 if sect in self.__charmeEnable__: 251 msg.append( charmeTempl % (self.__charmeEnable__[sect].site, 'u', self.uid) ) 234 252 msg.append( '<a href="../index.html">Home</a> → <a href="../index/%s.html">%s section index</a><br/>\n' % (sect, self._h.title) ) 235 253 msg.append( '<ul>' ) … … 303 321 elif self._base._indexInitialised: 304 322 msg += self.__irefHtml__(sect,ghis) 323 if sect in self.__charmeEnable__: 324 msg.append( '<script src="/js/dreq/charme/charme.js"></script>' ) 305 325 else: 306 326 msg.append( '<b>Item %s: uninitialised</b>' % self.sectionLabel ) -
CMIP6dreqbuild/trunk/src/framework/dreqPy/makeTables.py
r711 r712 1 1 2 2 import collections, string, os, sys 3 4 nt__charmeEnable = collections.namedtuple( 'charme', ['id','site'] ) 3 5 4 6 try: … … 770 772 dq.itemStyles['requestVar'] = styls.rqvLink01 771 773 774 dreq.dreqItemBase.__charmeEnable__['var'] = nt__charmeEnable( 'test','http://clipc-services.ceda.ac.uk/dreq' ) 775 772 776 ht = htmlTrees(dq) 773 777 dq.makeHtml( annotations={'var':ht.anno}, ttl0='Data Request [%s]' % dreq.version ) -
CMIP6dreqbuild/trunk/src/framework/dreqPy/misc_utils.py
r711 r712 1 import collections, string 1 import collections, string , os 2 import logging 3 import time 4 5 class dreqLog(object): 6 def __init__(self, dir='.'): 7 self.tstring2 = '%4.4i%2.2i%2.2i' % time.gmtime()[0:3] 8 self.logdir = dir 9 if not os.path.isdir( dir ): 10 os.mkdir(dir ) 11 print ( 'dreqLog: making a new directory fr log files: %s' % dir ) 12 13 def getLog(self,name,dir=None): 14 if dir == None: 15 dir = self.logdir 16 testLogFile = '%s/dreq_%s_%s.txt' % (dir,name,self.tstring2) 17 log = logging.getLogger(testLogFile) 18 fHdlr = logging.FileHandler(testLogFile,mode='w') 19 fileFormatter = logging.Formatter('%(message)s') 20 fHdlr.setFormatter(fileFormatter) 21 log.addHandler(fHdlr) 22 log.setLevel(logging.INFO) 23 return log 2 24 3 25 def rankCMORvars(dq): -
CMIP6dreqbuild/trunk/src/framework/dreqPy/scope.py
r711 r712 185 185 if i.odims != '': 186 186 s = s*5 187 self.sz[i.uid] = self.szss[i.spid]*s 188 for k in szr: 189 self.szg[k][i.uid] = self.szgss[k][i.spid]*s 187 if i.spid in self.szss: 188 self.sz[i.uid] = self.szss[i.spid]*s 189 for k in szr: 190 self.szg[k][i.uid] = self.szgss[k][i.spid]*s 191 else: 192 print ('WARNING: spid has no size info: %s' % i.spid ) 193 self.sz[i.uid] = 0. 194 for k in szr: 195 self.szg[k][i.uid] = 0. 190 196 191 197 def getRequestLinkByMip( self, mipSel ):
Note: See TracChangeset
for help on using the changeset viewer.