#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from prewikka import User
from prewikka.templates.ClassicLayout import ClassicLayout
##################################################
## MODULE CONSTANTS
try:
True, False
except NameError:
True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0'
__CHEETAH_versionTuple__ = (2, 0, 0, 'final', 0)
__CHEETAH_genTime__ = 1200702933.8402841
__CHEETAH_genTimestamp__ = 'Fri Jan 18 19:35:33 2008'
__CHEETAH_src__ = 'prewikka/templates/MessageListing.tmpl'
__CHEETAH_srcLastModified__ = 'Thu Oct 18 08:55:41 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, RequiredCheetahVersion))
##################################################
## CLASSES
class MessageListing(ClassicLayout):
##################################################
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
ClassicLayout.__init__(self, *args, **KWs)
if not self._CHEETAH__instanceInitialized:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self._initCheetahInstance(**cheetahKWArgs)
def layout_start_hook(self, **KWS):
## CHEETAH: generated from #def layout_start_hook at line 4, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def message_listing_header(self, **KWS):
## CHEETAH: generated from #def message_listing_header at line 158, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def main_content(self, **KWS):
## CHEETAH: generated from #block main_content at line 156, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
_v = VFFSL(SL,"message_listing_header",True) # '$message_listing_header' on line 160, col 1
if _v is not None: write(_filter(_v, rawExpr='$message_listing_header')) # from line 160, col 1.
write('''
''')
_v = VFFSL(SL,"message_fields_header",True) # '$message_fields_header' on line 163, col 3
if _v is not None: write(_filter(_v, rawExpr='$message_fields_header')) # from line 163, col 3.
write('''
''')
row_classes = ("table_row_even", "table_row_odd")
cnt = 0
write('''
''')
for message in VFFSL(SL,"messages",True): # generated from line 168, col 5
self._CHEETAH__globalSetVars["message"] = VFFSL(SL,"message",True)
write('''
''')
_v = VFFSL(SL,"message_fields",True) # '$message_fields' on line 171, col 11
if _v is not None: write(_filter(_v, rawExpr='$message_fields')) # from line 171, col 11.
write('''
''')
if VFN(VFFSL(SL,"prewikka.user",True),"has",False)(User.PERM_IDMEF_ALTER): # generated from line 173, col 13
write('''
''')
else: # generated from line 175, col 13
write('''
''')
write('''
''')
cnt += 1
write('''
''')
if VFN(VFFSL(SL,"prewikka.user",True),"has",False)(User.PERM_IDMEF_ALTER) and VFFSL(SL,"cnt",True): # generated from line 184, col 1
write('''
''')
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def timeline_extra_content(self, **KWS):
## CHEETAH: generated from #def timeline_extra_content at line 204, col 3.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def menu_extra_content(self, **KWS):
## CHEETAH: generated from #block menu_extra_content at line 201, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
_v = VFFSL(SL,"timeline_extra_content",True) # '$timeline_extra_content' on line 206, col 3
if _v is not None: write(_filter(_v, rawExpr='$timeline_extra_content')) # from line 206, col 3.
write('''
''')
if False:
_("Period")
_v = VFFSL(SL,"_",False)("Period") # '$_("Period")' on line 209, col 33
if _v is not None: write(_filter(_v, rawExpr='$_("Period")')) # from line 209, col 33.
write('''
''')
if False:
_("Timezone")
_v = VFFSL(SL,"_",False)("Timezone") # '$_("Timezone")' on line 224, col 37
if _v is not None: write(_filter(_v, rawExpr='$_("Timezone")')) # from line 224, col 37.
write('''
''')
if False:
_("Limit")
_v = VFFSL(SL,"_",False)("Limit") # '$_("Limit")' on line 235, col 34
if _v is not None: write(_filter(_v, rawExpr='$_("Limit")')) # from line 235, col 34.
write('''
''')
if False:
_("Refresh")
_v = VFFSL(SL,"_",False)("Refresh") # '$_("Refresh")' on line 243, col 31
if _v is not None: write(_filter(_v, rawExpr='$_("Refresh")')) # from line 243, col 31.
write('''
''')
if VFFSL(SL,"auto_apply_enable",True) == "true": # generated from line 246, col 5
img = "prewikka/images/pause.png"
else: # generated from line 248, col 5
img = "prewikka/images/play.png"
write('''
''')
if not VFFSL(SL,"timeline.start",True): # generated from line 275, col 1
write(''' Unlimited
-
''')
else: # generated from line 278, col 1
write(''' ''')
_v = VFFSL(SL,"timeline.start",True) # '$timeline.start' on line 279, col 2
if _v is not None: write(_filter(_v, rawExpr='$timeline.start')) # from line 279, col 2.
write('''
''')
_v = VFFSL(SL,"timeline.end",True) # '$timeline.end' on line 280, col 2
if _v is not None: write(_filter(_v, rawExpr='$timeline.end')) # from line 280, col 2.
write('''
''')
write(''' ''')
_v = VFFSL(SL,"timeline.range_timezone",True) # '$timeline.range_timezone' on line 282, col 2
if _v is not None: write(_filter(_v, rawExpr='$timeline.range_timezone')) # from line 282, col 2.
write('''
''')
if VFFSL(SL,"timeline.prev",True): # generated from line 291, col 5
write('''
''')
else: # generated from line 293, col 5
write('''
''')
if False:
_("prev")
_v = VFFSL(SL,"_",False)("prev") # '$_("prev")' on line 294, col 47
if _v is not None: write(_filter(_v, rawExpr='$_("prev")')) # from line 294, col 47.
write('''
''')
write('''
''')
if VFFSL(SL,"timeline.current",True): # generated from line 297, col 5
write('''
''')
else: # generated from line 299, col 5
write('''
''')
if False:
_("current")
_v = VFFSL(SL,"_",False)("current") # '$_("current")' on line 300, col 51
if _v is not None: write(_filter(_v, rawExpr='$_("current")')) # from line 300, col 51.
write('''
''')
write('''
''')
if VFFSL(SL,"timeline.next",True): # generated from line 303, col 5
write('''
''')
else: # generated from line 305, col 5
write('''
''')
if False:
_("next")
_v = VFFSL(SL,"_",False)("next") # '$_("next")' on line 306, col 47
if _v is not None: write(_filter(_v, rawExpr='$_("next")')) # from line 306, col 47.
write('''
''')
write('''
''')
if VFFSL(SL,"nav.prev",True): # generated from line 317, col 5
write('''
''')
else: # generated from line 327, col 5
write('''
>
>>
''')
write('''
''')
_v = VFFSL(SL,"nav.from",True) # '$nav.from' on line 334, col 7
if _v is not None: write(_filter(_v, rawExpr='$nav.from')) # from line 334, col 7.
write(''' ... ''')
_v = VFFSL(SL,"nav.to",True) # '$nav.to' on line 334, col 21
if _v is not None: write(_filter(_v, rawExpr='$nav.to')) # from line 334, col 21.
write(''' (''')
if False:
_("total")
_v = VFFSL(SL,"_",False)("total") # '$_("total")' on line 334, col 30
if _v is not None: write(_filter(_v, rawExpr='$_("total")')) # from line 334, col 30.
write(''':''')
_v = VFFSL(SL,"total",True) # '$total' on line 334, col 42
if _v is not None: write(_filter(_v, rawExpr='$total')) # from line 334, col 42.
write(''')
''')
_filter = _orig_filter_72957489
_orig_filter_24332764 = _filter
filterName = 'Filter'
if self._CHEETAH__filters.has_key("Filter"):
_filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
else:
_filter = self._CHEETAH__currentFilter = \
self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
_filter = _orig_filter_24332764
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def body(self, **KWS):
## CHEETAH: generated from #block body at line 344, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
_v = VFFSL(SL,"prewikka.software",True) # '$prewikka.software' on line 348, col 60
if _v is not None: write(_filter(_v, rawExpr='$prewikka.software')) # from line 348, col 60.
write('''
''')
_v = VFFSL(SL,"prewikka.place",True) # '$prewikka.place' on line 349, col 57
if _v is not None: write(_filter(_v, rawExpr='$prewikka.place')) # from line 349, col 57.
write('''
''')
_v = VFFSL(SL,"prewikka.title",True) # '$prewikka.title' on line 350, col 57
if _v is not None: write(_filter(_v, rawExpr='$prewikka.title')) # from line 350, col 57.
write('''
''')
_v = VFFSL(SL,"toplayout_content",True) # '$toplayout_content' on line 352, col 17
if _v is not None: write(_filter(_v, rawExpr='$toplayout_content')) # from line 352, col 17.
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def writeBody(self, **KWS):
## CHEETAH: main method generated for this template
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
self.main_content(trans=trans)
write('''
''')
self.menu_extra_content(trans=trans)
write('''
''')
self.body(trans=trans)
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
##################################################
## CHEETAH GENERATED ATTRIBUTES
_CHEETAH__instanceInitialized = False
_CHEETAH_version = __CHEETAH_version__
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
_CHEETAH_genTime = __CHEETAH_genTime__
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
_CHEETAH_src = __CHEETAH_src__
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
_mainCheetahMethod_for_MessageListing= 'writeBody'
## END CLASS DEFINITION
if not hasattr(MessageListing, '_initCheetahAttributes'):
templateAPIClass = getattr(MessageListing, '_CHEETAH_templateClass', Template)
templateAPIClass._addCheetahPlumbingCodeToClass(MessageListing)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/
##################################################
## if run from command line:
if __name__ == '__main__':
from Cheetah.TemplateCmdLineIface import CmdLineIface
CmdLineIface(templateObj=MessageListing()).run()