source: trunk/web/templates/skeleton.py @ 161

Last change on this file since 161 was 139, checked in by ecprice, 17 years ago

Help!

File size: 5.5 KB
Line 
1#!/usr/bin/env python
2
3
4
5
6##################################################
7## DEPENDENCIES
8import sys
9import os
10import os.path
11from os.path import getmtime, exists
12import time
13import types
14import __builtin__
15from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
16from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
17from Cheetah.Template import Template
18from Cheetah.DummyTransaction import DummyTransaction
19from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
20from Cheetah.CacheRegion import CacheRegion
21import Cheetah.Filters as Filters
22import Cheetah.ErrorCatchers as ErrorCatchers
23
24##################################################
25## MODULE CONSTANTS
26try:
27    True, False
28except NameError:
29    True, False = (1==1), (1==0)
30VFFSL=valueFromFrameOrSearchList
31VFSL=valueFromSearchList
32VFN=valueForName
33currentTime=time.time
34__CHEETAH_version__ = '2.0rc8'
35__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8)
36__CHEETAH_genTime__ = 1191828896.641397
37__CHEETAH_genTimestamp__ = 'Mon Oct  8 03:34:56 2007'
38__CHEETAH_src__ = 'skeleton.tmpl'
39__CHEETAH_srcLastModified__ = 'Mon Oct  8 03:34:52 2007'
40__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
41
42if __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
51class skeleton(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 respond(self, trans=None):
69
70
71
72        ## CHEETAH: main method generated for this template
73        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
74            trans = self.transaction # is None unless self.awake() was called
75        if not trans:
76            trans = DummyTransaction()
77            _dummyTrans = True
78        else: _dummyTrans = False
79        write = trans.response().write
80        SL = self._CHEETAH__searchList
81        _filter = self._CHEETAH__currentFilter
82       
83        ########################################
84        ## START - generated method body
85       
86        write('''<html>
87<head><title>''')
88        _v = VFFSL(SL,"title",True) # '$title' on line 2, col 14
89        if _v is not None: write(_filter(_v, rawExpr='$title')) # from line 2, col 14.
90        write('''</title>
91  <link href="/static/favicon.ico" type="image/x-icon" rel="shortcut icon">
92  <style media="screen" type="text/css">
93    @import "static/css/all.css";
94  </style>
95  <script type="text/javascript">
96var helpWin = null;
97function closeWin(){
98\tif (helpWin != null){
99\t\tif(!helpWin.closed)
100\t\t\thelpWin.close();
101\t}
102}
103
104function helppopup(name){
105   closeWin()
106   helpWin = window.open("help?simple=true&subject="+encodeURIComponent(name), "HMMTHelp",
107"status, height = 300, width = 400");
108   if (window.focus){helpWin.focus();}
109   return false;
110}
111</script>
112</head>
113<body>
114''')
115        if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 26, col 1
116            write('''<p>[You are logged in as ''')
117            _v = VFFSL(SL,"user.username",True) # '$user.username' on line 27, col 26
118            if _v is not None: write(_filter(_v, rawExpr='$user.username')) # from line 27, col 26.
119            write('''.]</p>
120''')
121        _v = VFFSL(SL,"body",True) # '$body' on line 29, col 1
122        if _v is not None: write(_filter(_v, rawExpr='$body')) # from line 29, col 1.
123        write('''
124''')
125        if not VFFSL(SL,"varExists",False)('simple') or not VFFSL(SL,"simple",True): # generated from line 30, col 1
126            write('''<hr />
127Questions? Contact <a href="mailto:sipb-xen-dev@mit.edu">sipb-xen-dev@mit.edu</a>.
128''')
129        write('''</body>
130</html>
131''')
132       
133        ########################################
134        ## END - generated method body
135       
136        return _dummyTrans and trans.response().getvalue() or ""
137       
138    ##################################################
139    ## CHEETAH GENERATED ATTRIBUTES
140
141
142    _CHEETAH__instanceInitialized = False
143
144    _CHEETAH_version = __CHEETAH_version__
145
146    _CHEETAH_versionTuple = __CHEETAH_versionTuple__
147
148    _CHEETAH_genTime = __CHEETAH_genTime__
149
150    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
151
152    _CHEETAH_src = __CHEETAH_src__
153
154    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
155
156    _mainCheetahMethod_for_skeleton= 'respond'
157
158## END CLASS DEFINITION
159
160if not hasattr(skeleton, '_initCheetahAttributes'):
161    templateAPIClass = getattr(skeleton, '_CHEETAH_templateClass', Template)
162    templateAPIClass._addCheetahPlumbingCodeToClass(skeleton)
163
164
165# CHEETAH was developed by Tavis Rudd and Mike Orr
166# with code, advice and input from many other volunteers.
167# For more information visit http://www.CheetahTemplate.org/
168
169##################################################
170## if run from command line:
171if __name__ == '__main__':
172    from Cheetah.TemplateCmdLineIface import CmdLineIface
173    CmdLineIface(templateObj=skeleton()).run()
174
175
Note: See TracBrowser for help on using the repository browser.