6
##################################################
11
from os.path import getmtime, exists
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
from prewikka.templates.TopLayout import TopLayout
25
##################################################
30
True, False = (1==1), (1==0)
31
VFFSL=valueFromFrameOrSearchList
32
VFSL=valueFromSearchList
35
__CHEETAH_version__ = '2.0rc7'
36
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 7)
37
__CHEETAH_genTime__ = 1175011473.104785
38
__CHEETAH_genTimestamp__ = 'Tue Mar 27 18:04:33 2007'
39
__CHEETAH_src__ = 'prewikka/templates/ClassicLayout.tmpl'
40
__CHEETAH_srcLastModified__ = 'Tue Mar 27 18:04:24 2007'
41
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
43
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
45
'This template was compiled with Cheetah version'
46
' %s. Templates compiled before version %s must be recompiled.'%(
47
__CHEETAH_version__, RequiredCheetahVersion))
49
##################################################
52
class ClassicLayout(TopLayout):
54
##################################################
55
## CHEETAH GENERATED METHODS
58
def __init__(self, *args, **KWs):
60
TopLayout.__init__(self, *args, **KWs)
61
if not self._CHEETAH__instanceInitialized:
63
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
64
for k,v in KWs.items():
65
if k in allowedKWs: cheetahKWArgs[k] = v
66
self._initCheetahInstance(**cheetahKWArgs)
69
def body_class(self, **KWS):
73
## CHEETAH: generated from #def body_class() at line 3, col 1.
74
trans = KWS.get("trans")
75
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
76
trans = self.transaction # is None unless self.awake() was called
78
trans = DummyTransaction()
80
else: _dummyTrans = False
81
write = trans.response().write
82
SL = self._CHEETAH__searchList
83
_filter = self._CHEETAH__currentFilter
85
########################################
86
## START - generated method body
88
write('classic_body\n')
90
########################################
91
## END - generated method body
93
return _dummyTrans and trans.response().getvalue() or ""
96
def layout_start_hook(self, **KWS):
100
## CHEETAH: generated from #def layout_start_hook at line 35, col 1.
101
trans = KWS.get("trans")
102
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
103
trans = self.transaction # is None unless self.awake() was called
105
trans = DummyTransaction()
107
else: _dummyTrans = False
108
write = trans.response().write
109
SL = self._CHEETAH__searchList
110
_filter = self._CHEETAH__currentFilter
112
########################################
113
## START - generated method body
116
########################################
117
## END - generated method body
119
return _dummyTrans and trans.response().getvalue() or ""
122
def menu_extra_content(self, **KWS):
126
## CHEETAH: generated from #def menu_extra_content at line 53, col 3.
127
trans = KWS.get("trans")
128
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
129
trans = self.transaction # is None unless self.awake() was called
131
trans = DummyTransaction()
133
else: _dummyTrans = False
134
write = trans.response().write
135
SL = self._CHEETAH__searchList
136
_filter = self._CHEETAH__currentFilter
138
########################################
139
## START - generated method body
142
########################################
143
## END - generated method body
145
return _dummyTrans and trans.response().getvalue() or ""
148
def layout_end_hook(self, **KWS):
152
## CHEETAH: generated from #def layout_end_hook at line 60, col 1.
153
trans = KWS.get("trans")
154
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
155
trans = self.transaction # is None unless self.awake() was called
157
trans = DummyTransaction()
159
else: _dummyTrans = False
160
write = trans.response().write
161
SL = self._CHEETAH__searchList
162
_filter = self._CHEETAH__currentFilter
164
########################################
165
## START - generated method body
168
########################################
169
## END - generated method body
171
return _dummyTrans and trans.response().getvalue() or ""
174
def toplayout_content(self, **KWS):
178
## CHEETAH: generated from #block toplayout_content at line 7, col 1.
179
trans = KWS.get("trans")
180
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
181
trans = self.transaction # is None unless self.awake() was called
183
trans = DummyTransaction()
185
else: _dummyTrans = False
186
write = trans.response().write
187
SL = self._CHEETAH__searchList
188
_filter = self._CHEETAH__currentFilter
190
########################################
191
## START - generated method body
193
_orig_filter_71218738 = _filter
194
filterName = 'CleanOutput'
195
if self._CHEETAH__filters.has_key("CleanOutput"):
196
_filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
198
_filter = self._CHEETAH__currentFilter = \
199
self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
200
write('\n<div id="topmenu">\n')
201
for name, link in VFFSL(SL,"interface.tabs",True): # generated from line 11, col 3
202
if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_tab",True): # generated from line 12, col 5
203
class_ = 'topmenu_item_active'
204
else: # generated from line 14, col 5
205
class_ = 'topmenu_item_inactive'
206
write(' <div class="')
207
_v = VFFSL(SL,"class_",True) # '$class_' on line 17, col 17
208
if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 17, col 17.
209
write('"><p><a href="')
210
_v = VFFSL(SL,"link",True) # '$link' on line 17, col 38
211
if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 17, col 38.
213
_v = VFFSL(SL,"name",True) # '$name' on line 17, col 45
214
if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 17, col 45.
215
write('</a></p></div>\n')
216
write('\n <div class="topmenu_item_special">\n')
217
if VFFSL(SL,"prewikka.logout_link",True): # generated from line 21, col 3
218
write(' <p><a href="')
219
_v = VFFSL(SL,"prewikka.logout_link",True) # '$prewikka.logout_link' on line 22, col 17
220
if _v is not None: write(_filter(_v, rawExpr='$prewikka.logout_link')) # from line 22, col 17.
224
_v = VFFSL(SL,"_",False)("logout") # '$_("logout")' on line 22, col 40
225
if _v is not None: write(_filter(_v, rawExpr='$_("logout")')) # from line 22, col 40.
229
<div class="topmenu_item_info">
231
if VFFSL(SL,"prewikka.user",True): # generated from line 27, col 5
232
write(' <p><b><a href="?view=user_settings_display">')
233
_v = VFFSL(SL,"prewikka.user.login",True) # '$prewikka.user.login' on line 28, col 50
234
if _v is not None: write(_filter(_v, rawExpr='$prewikka.user.login')) # from line 28, col 50.
235
write('</a></b> on ')
236
_v = VFFSL(SL,"prewikka.date",True) # '$prewikka.date' on line 28, col 82
237
if _v is not None: write(_filter(_v, rawExpr='$prewikka.date')) # from line 28, col 82.
239
write(' </div>\n</div>\n')
240
_filter = _orig_filter_71218738
241
_orig_filter_20396549 = _filter
242
filterName = 'Filter'
243
if self._CHEETAH__filters.has_key("Filter"):
244
_filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
246
_filter = self._CHEETAH__currentFilter = \
247
self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
249
_v = VFFSL(SL,"layout_start_hook",True) # '$layout_start_hook' on line 37, col 1
250
if _v is not None: write(_filter(_v, rawExpr='$layout_start_hook')) # from line 37, col 1.
252
_filter = _orig_filter_20396549
253
_orig_filter_83178734 = _filter
254
filterName = 'CleanOutput'
255
if self._CHEETAH__filters.has_key("CleanOutput"):
256
_filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
258
_filter = self._CHEETAH__currentFilter = \
259
self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
260
write('<div id="menu">\n')
261
for name, link in VFFSL(SL,"interface.sections",True): # generated from line 42, col 3
262
if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_section",True): # generated from line 43, col 5
263
class_ = 'menu_item_active'
264
else: # generated from line 45, col 5
265
class_ = 'menu_item_inactive'
267
_v = VFFSL(SL,"class_",True) # '$class_' on line 48, col 15
268
if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 48, col 15.
270
_v = VFFSL(SL,"link",True) # '$link' on line 48, col 30
271
if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 48, col 30.
273
_v = VFFSL(SL,"name",True) # '$name' on line 48, col 37
274
if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 48, col 37.
277
_filter = _orig_filter_83178734
278
_orig_filter_80288541 = _filter
279
filterName = 'Filter'
280
if self._CHEETAH__filters.has_key("Filter"):
281
_filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
283
_filter = self._CHEETAH__currentFilter = \
284
self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
286
_v = VFFSL(SL,"menu_extra_content",True) # '$menu_extra_content' on line 55, col 3
287
if _v is not None: write(_filter(_v, rawExpr='$menu_extra_content')) # from line 55, col 3.
292
_v = VFFSL(SL,"main_content",True) # '$main_content' on line 58, col 16
293
if _v is not None: write(_filter(_v, rawExpr='$main_content')) # from line 58, col 16.
295
_v = VFFSL(SL,"layout_end_hook",True) # '$layout_end_hook' on line 62, col 1
296
if _v is not None: write(_filter(_v, rawExpr='$layout_end_hook')) # from line 62, col 1.
298
_filter = _orig_filter_80288541
300
########################################
301
## END - generated method body
303
return _dummyTrans and trans.response().getvalue() or ""
306
def writeBody(self, **KWS):
310
## CHEETAH: main method generated for this template
311
trans = KWS.get("trans")
312
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
313
trans = self.transaction # is None unless self.awake() was called
315
trans = DummyTransaction()
317
else: _dummyTrans = False
318
write = trans.response().write
319
SL = self._CHEETAH__searchList
320
_filter = self._CHEETAH__currentFilter
322
########################################
323
## START - generated method body
326
self.toplayout_content(trans=trans)
328
########################################
329
## END - generated method body
331
return _dummyTrans and trans.response().getvalue() or ""
333
##################################################
334
## CHEETAH GENERATED ATTRIBUTES
337
_CHEETAH__instanceInitialized = False
339
_CHEETAH_version = __CHEETAH_version__
341
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
343
_CHEETAH_genTime = __CHEETAH_genTime__
345
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
347
_CHEETAH_src = __CHEETAH_src__
349
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
351
_mainCheetahMethod_for_ClassicLayout= 'writeBody'
353
## END CLASS DEFINITION
355
if not hasattr(ClassicLayout, '_initCheetahAttributes'):
356
templateAPIClass = getattr(ClassicLayout, '_CHEETAH_templateClass', Template)
357
templateAPIClass._addCheetahPlumbingCodeToClass(ClassicLayout)
360
# CHEETAH was developed by Tavis Rudd and Mike Orr
361
# with code, advice and input from many other volunteers.
362
# For more information visit http://www.CheetahTemplate.org/
364
##################################################
365
## if run from command line:
366
if __name__ == '__main__':
367
from Cheetah.TemplateCmdLineIface import CmdLineIface
368
CmdLineIface(templateObj=ClassicLayout()).run()