Changeset 205 for trunk/web/templates/skeleton.py
- Timestamp:
- Oct 20, 2007, 8:28:32 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/skeleton.py
r187 r205 21 21 import Cheetah.Filters as Filters 22 22 import Cheetah.ErrorCatchers as ErrorCatchers 23 from functions import functions 23 24 24 25 ################################################## … … 34 35 __CHEETAH_version__ = '2.0rc8' 35 36 __CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8) 36 __CHEETAH_genTime__ = 1192 082083.44486537 __CHEETAH_genTimestamp__ = ' Thu Oct 11 01:54:432007'37 __CHEETAH_genTime__ = 1192883107.2947011 38 __CHEETAH_genTimestamp__ = 'Sat Oct 20 08:25:07 2007' 38 39 __CHEETAH_src__ = 'skeleton.tmpl' 39 __CHEETAH_srcLastModified__ = ' Thu Oct 11 01:54:41 2007'40 __CHEETAH_srcLastModified__ = 'Sat Oct 20 08:22:11 2007' 40 41 __CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine' 41 42 … … 49 50 ## CLASSES 50 51 51 class skeleton( Template):52 class skeleton(functions): 52 53 53 54 ################################################## … … 57 58 def __init__(self, *args, **KWs): 58 59 59 Template.__init__(self, *args, **KWs)60 functions.__init__(self, *args, **KWs) 60 61 if not self._CHEETAH__instanceInitialized: 61 62 cheetahKWArgs = {} … … 66 67 67 68 68 def respond(self, trans=None): 69 70 71 72 ## CHEETAH: main method generated for this template 69 def full_body(self, **KWS): 70 71 72 73 ## CHEETAH: generated from #def full_body at line 4, col 1. 74 trans = KWS.get("trans") 73 75 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): 74 76 trans = self.transaction # is None unless self.awake() was called … … 84 86 ## START - generated method body 85 87 86 write('''<html> 88 write('''<!DOCTYPE html 89 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 90 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 91 <html> 87 92 <head><title>''') 88 _v = VFFSL(SL,"title",True) # '$title' on line 2, col 1489 if _v is not None: write(_filter(_v, rawExpr='$title')) # from line 2, col 14.93 _v = VFFSL(SL,"title",True) # '$title' on line 9, col 14 94 if _v is not None: write(_filter(_v, rawExpr='$title')) # from line 9, col 14. 90 95 write('''</title> 91 96 <link href="static/favicon.ico" type="image/x-icon" rel="shortcut icon"> 92 97 <link rel="stylesheet" href="static/style.css" type="text/css" /> 93 98 <link rel="stylesheet" href="static/layout.css" type="text/css" media="screen" /> 99 <script type="text/javascript" src="static/prototype.js"></script> 94 100 <script type="text/javascript"> 95 101 var helpWin = null; … … 108 114 return false; 109 115 } 116 117 Ajax.Responders.register({ 118 onCreate: function(){ 119 if (Ajax.activeRequestCount > 0) { 120 document.getElementById("loadingnotice").style.display = \'block\'; 121 } 122 }, 123 onComplete: function(){ 124 if (Ajax.activeRequestCount == 0) { 125 document.getElementById("loadingnotice").style.display = \'none\'; 126 } 127 } 128 }); 129 function replaceFunc(transport) { 130 try { 131 d = transport.responseText.evalJSON(); 132 } catch (e) { 133 $(\'body\').innerHTML = \'<pre>\'+transport.responseText+\'</pre>\' 134 return; 135 } 136 for(key in d) { 137 $(key).innerHTML = d[key]; 138 } 139 } 140 141 function jsFormSubmit(location, elt){ 142 new Ajax.Request(location, {method: \'post\', 143 parameters: Form.serialize(elt)+\'&js=true\', 144 onSuccess: replaceFunc, 145 onComplete: function() {Form.enable(elt);} 146 }); 147 Form.disable(elt); 148 return false; 149 } 150 151 function rowFormSubmit(elt, retpage){ 152 new Ajax.Request(\'command\', {method: \'post\', 153 parameters: Form.serialize(elt)+\'&js=\'+retpage, 154 onSuccess: replaceFunc 155 }); 156 return false; 157 } 158 159 window.onload = { 160 //Fix bug with disabled elements 161 $''') 162 _v = 'form' # "$('form')" on line 75, col 4 163 if _v is not None: write(_filter(_v, rawExpr="$('form')")) # from line 75, col 4. 164 write('''.each(Form.enable); 165 } 166 110 167 </script> 111 168 </head> 112 <body> 113 ''') 114 if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 25, col 1 169 <body id="body"> 170 171 <div id="err"> 172 ''') 173 if VFFSL(SL,"varExists",False)('error_text'): # generated from line 83, col 1 174 write('''<p>STDERR:</p><pre>''') 175 _v = VFFSL(SL,"error_text",True) # '$error_text' on line 84, col 20 176 if _v is not None: write(_filter(_v, rawExpr='$error_text')) # from line 84, col 20. 177 write('''</pre> 178 ''') 179 write('''</div> 180 181 ''') 182 if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 88, col 1 115 183 write('''<p>[You are logged in as ''') 116 _v = VFFSL(SL,"user.username",True) # '$user.username' on line 26, col 26117 if _v is not None: write(_filter(_v, rawExpr='$user.username')) # from line 26, col 26.184 _v = VFFSL(SL,"user.username",True) # '$user.username' on line 89, col 26 185 if _v is not None: write(_filter(_v, rawExpr='$user.username')) # from line 89, col 26. 118 186 write('''.]</p> 187 188 <div class="navigation"> 119 189 <p><a href="list">List</a> 120 190 ''') 121 if VFFSL(SL,"varExists",False)('machine'): # generated from line 28, col 1191 if VFFSL(SL,"varExists",False)('machine'): # generated from line 93, col 1 122 192 write('''<a href="info?machine_id=''') 123 _v = VFFSL(SL,"machine.machine_id",True) # '$machine.machine_id' on line 29, col 26124 if _v is not None: write(_filter(_v, rawExpr='$machine.machine_id')) # from line 29, col 26.193 _v = VFFSL(SL,"machine.machine_id",True) # '$machine.machine_id' on line 94, col 26 194 if _v is not None: write(_filter(_v, rawExpr='$machine.machine_id')) # from line 94, col 26. 125 195 write('''">Info</a> 126 196 <a href="vnc?machine_id=''') 127 _v = VFFSL(SL,"machine.machine_id",True) # '$machine.machine_id' on line 30, col 25128 if _v is not None: write(_filter(_v, rawExpr='$machine.machine_id')) # from line 30, col 25.197 _v = VFFSL(SL,"machine.machine_id",True) # '$machine.machine_id' on line 95, col 25 198 if _v is not None: write(_filter(_v, rawExpr='$machine.machine_id')) # from line 95, col 25. 129 199 write('''">Console</a> 130 200 ''') 131 201 write('''<a href="help">Help</a></p> 132 202 ''') 133 _v = VFFSL(SL,"body",True) # '$body' on line 34, col 1 134 if _v is not None: write(_filter(_v, rawExpr='$body')) # from line 34, col 1. 203 write('''</div> 204 205 <div id="loadingnotice" class="loadingnotice">LOADING</div> 206 <div id="result" class="result"></div> 207 208 ''') 209 _v = VFFSL(SL,"body",True) # '$body' on line 104, col 1 210 if _v is not None: write(_filter(_v, rawExpr='$body')) # from line 104, col 1. 135 211 write(''' 136 212 ''') 137 if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 35, col 1213 if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 105, col 1 138 214 write('''<hr /> 139 215 Questions? Contact <a href="mailto:sipb-xen-dev@mit.edu">sipb-xen-dev@mit.edu</a>. … … 148 224 return _dummyTrans and trans.response().getvalue() or "" 149 225 226 227 def writeBody(self, **KWS): 228 229 230 231 ## CHEETAH: main method generated for this template 232 trans = KWS.get("trans") 233 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): 234 trans = self.transaction # is None unless self.awake() was called 235 if not trans: 236 trans = DummyTransaction() 237 _dummyTrans = True 238 else: _dummyTrans = False 239 write = trans.response().write 240 SL = self._CHEETAH__searchList 241 _filter = self._CHEETAH__currentFilter 242 243 ######################################## 244 ## START - generated method body 245 246 write(''' 247 ''') 248 249 ######################################## 250 ## END - generated method body 251 252 return _dummyTrans and trans.response().getvalue() or "" 253 150 254 ################################################## 151 255 ## CHEETAH GENERATED ATTRIBUTES … … 166 270 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__ 167 271 168 _mainCheetahMethod_for_skeleton= ' respond'272 _mainCheetahMethod_for_skeleton= 'writeBody' 169 273 170 274 ## END CLASS DEFINITION
Note: See TracChangeset
for help on using the changeset viewer.