Package zephir :: Package monitor :: Package agentmanager :: Package templates :: Module PageTmpl
[hide private]
[frames] | no frames]

Source Code for Module zephir.monitor.agentmanager.templates.PageTmpl

  1  #!/usr/bin/env python 
  2   
  3   
  4   
  5   
  6  ################################################## 
  7  ## DEPENDENCIES 
  8  import sys 
  9  import os 
 10  import os.path 
 11  from os.path import getmtime, exists 
 12  import time 
 13  import types 
 14  import __builtin__ 
 15  from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion 
 16  from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple 
 17  from Cheetah.Template import Template 
 18  from Cheetah.DummyTransaction import DummyTransaction 
 19  from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList 
 20  from Cheetah.CacheRegion import CacheRegion 
 21  import Cheetah.Filters as Filters 
 22  import Cheetah.ErrorCatchers as ErrorCatchers 
 23   
 24  ################################################## 
 25  ## MODULE CONSTANTS 
 26  try: 
 27      True, False 
 28  except NameError: 
 29      True, False = (1==1), (1==0) 
 30  VFFSL=valueFromFrameOrSearchList 
 31  VFSL=valueFromSearchList 
 32  VFN=valueForName 
 33  currentTime=time.time 
 34  __CHEETAH_version__ = '2.0rc7' 
 35  __CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 7) 
 36  __CHEETAH_genTime__ = 1190887606.5106139 
 37  __CHEETAH_genTimestamp__ = 'Thu Sep 27 12:06:46 2007' 
 38  __CHEETAH_src__ = 'PageTmpl.tmpl' 
 39  __CHEETAH_srcLastModified__ = 'Tue Jan 23 10:43:33 2007' 
 40  __CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine' 
 41   
 42  if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: 
 43      raise AssertionError( 
 44        'This template was compiled with Cheetah version' 
 45        ' %s. Templates compiled before version %s must be recompiled.'%( 
 46           __CHEETAH_version__, RequiredCheetahVersion)) 
 47   
 48  ################################################## 
 49  ## CLASSES 
 50   
51 -class PageTmpl(Template):
52 53 ################################################## 54 ## CHEETAH GENERATED METHODS 55 56
57 - def __init__(self, *args, **KWs):
58 59 Template.__init__(self, *args, **KWs) 60 if not self._CHEETAH__instanceInitialized: 61 cheetahKWArgs = {} 62 allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split() 63 for k,v in KWs.items(): 64 if k in allowedKWs: cheetahKWArgs[k] = v 65 self._initCheetahInstance(**cheetahKWArgs)
66 67
68 - def head(self, pagetitle, **KWS):
69 70 71 72 ## CHEETAH: generated from #def head($pagetitle) at line 2, col 1. 73 trans = KWS.get("trans") 74 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): 75 trans = self.transaction # is None unless self.awake() was called 76 if not trans: 77 trans = DummyTransaction() 78 _dummyTrans = True 79 else: _dummyTrans = False 80 write = trans.response().write 81 SL = self._CHEETAH__searchList 82 _filter = self._CHEETAH__currentFilter 83 84 ######################################## 85 ## START - generated method body 86 87 write('''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 88 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 89 <head> 90 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 91 <title>''') 92 _v = VFFSL(SL,"pagetitle",True) # '$pagetitle' on line 7, col 12 93 if _v is not None: write(_filter(_v, rawExpr='$pagetitle')) # from line 7, col 12. 94 write('</title>\n <link rel="stylesheet" href="') 95 _v = VFFSL(SL,"static_base",True) # '$static_base' on line 8, col 34 96 if _v is not None: write(_filter(_v, rawExpr='$static_base')) # from line 8, col 34. 97 write('''/stylesheet.css" type="text/css" /> 98 </head> 99 100 <body> 101 ''') 102 103 ######################################## 104 ## END - generated method body 105 106 return _dummyTrans and trans.response().getvalue() or ""
107 108
109 - def foot(self, **KWS):
110 111 112 113 ## CHEETAH: generated from #def foot at line 14, col 1. 114 trans = KWS.get("trans") 115 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): 116 trans = self.transaction # is None unless self.awake() was called 117 if not trans: 118 trans = DummyTransaction() 119 _dummyTrans = True 120 else: _dummyTrans = False 121 write = trans.response().write 122 SL = self._CHEETAH__searchList 123 _filter = self._CHEETAH__currentFilter 124 125 ######################################## 126 ## START - generated method body 127 128 write(' </body>\n</html>\n') 129 130 ######################################## 131 ## END - generated method body 132 133 return _dummyTrans and trans.response().getvalue() or ""
134 135
136 - def respond(self, trans=None):
137 138 139 140 ## CHEETAH: main method generated for this template 141 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): 142 trans = self.transaction # is None unless self.awake() was called 143 if not trans: 144 trans = DummyTransaction() 145 _dummyTrans = True 146 else: _dummyTrans = False 147 write = trans.response().write 148 SL = self._CHEETAH__searchList 149 _filter = self._CHEETAH__currentFilter 150 151 ######################################## 152 ## START - generated method body 153 154 write('<!-- #encoding utf-8 -->\n\n') 155 156 ######################################## 157 ## END - generated method body 158 159 return _dummyTrans and trans.response().getvalue() or ""
160 161 ################################################## 162 ## CHEETAH GENERATED ATTRIBUTES 163 164 165 _CHEETAH__instanceInitialized = False 166 167 _CHEETAH_version = __CHEETAH_version__ 168 169 _CHEETAH_versionTuple = __CHEETAH_versionTuple__ 170 171 _CHEETAH_genTime = __CHEETAH_genTime__ 172 173 _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__ 174 175 _CHEETAH_src = __CHEETAH_src__ 176 177 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__ 178 179 _mainCheetahMethod_for_PageTmpl= 'respond'
180 181 ## END CLASS DEFINITION 182 183 if not hasattr(PageTmpl, '_initCheetahAttributes'): 184 templateAPIClass = getattr(PageTmpl, '_CHEETAH_templateClass', Template) 185 templateAPIClass._addCheetahPlumbingCodeToClass(PageTmpl) 186 187 188 # CHEETAH was developed by Tavis Rudd and Mike Orr 189 # with code, advice and input from many other volunteers. 190 # For more information visit http://www.CheetahTemplate.org/ 191 192 ################################################## 193 ## if run from command line: 194 if __name__ == '__main__': 195 from Cheetah.TemplateCmdLineIface import CmdLineIface 196 CmdLineIface(templateObj=PageTmpl()).run() 197