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

Last change on this file since 123 was 113, checked in by ecprice, 17 years ago

Initial import of web interface.

File size: 4.7 KB
RevLine 
[113]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__ = 1191718104.9039481
37__CHEETAH_genTimestamp__ = 'Sat Oct  6 20:48:24 2007'
38__CHEETAH_src__ = 'skeleton.tmpl'
39__CHEETAH_srcLastModified__ = 'Sat Oct  6 20:18:06 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></head>
91<body>
92<p>[You are logged in as ''')
93        _v = VFFSL(SL,"user.username",True) # '$user.username' on line 4, col 26
94        if _v is not None: write(_filter(_v, rawExpr='$user.username')) # from line 4, col 26.
95        write('''.]</p>
96''')
97        _v = VFFSL(SL,"body",True) # '$body' on line 5, col 1
98        if _v is not None: write(_filter(_v, rawExpr='$body')) # from line 5, col 1.
99        write('''
100<hr />
101Questions? Contact <a href="mailto:sipb-xen-dev@mit.edu">sipb-xen-dev@mit.edu</a>.
102</body>
103</html>
104''')
105       
106        ########################################
107        ## END - generated method body
108       
109        return _dummyTrans and trans.response().getvalue() or ""
110       
111    ##################################################
112    ## CHEETAH GENERATED ATTRIBUTES
113
114
115    _CHEETAH__instanceInitialized = False
116
117    _CHEETAH_version = __CHEETAH_version__
118
119    _CHEETAH_versionTuple = __CHEETAH_versionTuple__
120
121    _CHEETAH_genTime = __CHEETAH_genTime__
122
123    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
124
125    _CHEETAH_src = __CHEETAH_src__
126
127    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
128
129    _mainCheetahMethod_for_skeleton= 'respond'
130
131## END CLASS DEFINITION
132
133if not hasattr(skeleton, '_initCheetahAttributes'):
134    templateAPIClass = getattr(skeleton, '_CHEETAH_templateClass', Template)
135    templateAPIClass._addCheetahPlumbingCodeToClass(skeleton)
136
137
138# CHEETAH was developed by Tavis Rudd and Mike Orr
139# with code, advice and input from many other volunteers.
140# For more information visit http://www.CheetahTemplate.org/
141
142##################################################
143## if run from command line:
144if __name__ == '__main__':
145    from Cheetah.TemplateCmdLineIface import CmdLineIface
146    CmdLineIface(templateObj=skeleton()).run()
147
148
Note: See TracBrowser for help on using the repository browser.