#!/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.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.4929199 __CHEETAH_genTimestamp__ = 'Fri Jan 18 19:35:33 2008' __CHEETAH_src__ = 'prewikka/templates/MessageSummary.tmpl' __CHEETAH_srcLastModified__ = 'Fri Aug 10 09:14:40 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 MessageSummary(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 3, 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 display_table(self, section, depth, **KWS): ## CHEETAH: generated from #def display_table($section, $depth) at line 29, 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(''' ''') table_cnt = 0 for table in VFFSL(SL,"section.tables",True): # generated from line 32, col 3 write('''\t\t ''') if VFFSL(SL,"depth",True) == 0 and VFFSL(SL,"table_cnt",True) > 0 and VFN(VFFSL(SL,"table.style",True),"find",False)("inline") == -1: # generated from line 34, col 3 write('''\t\t
''') write(''' ''') if VFFSL(SL,"table.odd_even",True): # generated from line 38, col 17 write('''\t\t ''') else: # generated from line 40, col 3 write('''\t\t
''') write(''' ''') table_cnt += 1 row_class = "" for row in VFFSL(SL,"table.rows",True): # generated from line 46, col 4 write('''\t\t ''') for col in row: # generated from line 48, col 6 if VFFSL(SL,"col.header",True): # generated from line 49, col 7 write('''\t\t ''') row_class = "table_row_even" elif VFFSL(SL,"col.tables",True): # generated from line 52, col 7 write('''\t\t ''') row_class = "" else: # generated from line 55, col 21 write('''\t\t ''') write('''\t\t ''') write('''\t\t
''') _v = VFFSL(SL,"col.name",True) # '$col.name' on line 50, col 12 if _v is not None: write(_filter(_v, rawExpr='$col.name')) # from line 50, col 12. write('''''') _v = VFFSL(SL,"display_table",False)(VFFSL(SL,"col",True), VFFSL(SL,"depth",True) + 1) # '$display_table($col, $depth + 1)' on line 53, col 12 if _v is not None: write(_filter(_v, rawExpr='$display_table($col, $depth + 1)')) # from line 53, col 12. write('''''') _v = VFFSL(SL,"col.name",True) # '$col.name' on line 56, col 31 if _v is not None: write(_filter(_v, rawExpr='$col.name')) # from line 56, col 31. write('''
''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" def display_node(self, sections, **KWS): ## CHEETAH: generated from #def display_node($sections) at line 66, 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 for section in VFFSL(SL,"sections",True): # generated from line 67, col 1 write('''
\t\t''') _v = VFFSL(SL,"section.title",True) # '$section.title' on line 69, col 23 if _v is not None: write(_filter(_v, rawExpr='$section.title')) # from line 69, col 23. write(''' \t\t
\t\t''') _v = VFFSL(SL,"display_table",False)(VFFSL(SL,"section",True), 0) # '$display_table($section, 0)' on line 71, col 3 if _v is not None: write(_filter(_v, rawExpr='$display_table($section, 0)')) # from line 71, col 3. write(''' ''') if VFFSL(SL,"section.entries",True): # generated from line 73, col 3 write('''\t\t \t\t\t ''') cnt = 0 for entry in VFFSL(SL,"section.entries",True): # generated from line 77, col 4 write(''' \t\t\t\t ''') if VFFSL(SL,"entry.name",True): # generated from line 81, col 19 write(''' ''') write('''\t\t\t\t \t\t\t\t ''') cnt += 1 write('''\t\t
''') _v = VFFSL(SL,"entry.name",True) # '$entry.name' on line 82, col 77 if _v is not None: write(_filter(_v, rawExpr='$entry.name')) # from line 82, col 77. write('''''') _v = VFFSL(SL,"entry.value",True) # '$entry.value' on line 84, col 55 if _v is not None: write(_filter(_v, rawExpr='$entry.value')) # from line 84, col 55. write('''
''') write(''' ''') self._CHEETAH__globalSetVars["section_cnt"] += 1 write(''' ''') if VFFSL(SL,"section.sections",True): # generated from line 94, col 3 write('''\t\t ''') _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"section.sections",True)) # '$display_node($section.sections)' on line 95, col 7 if _v is not None: write(_filter(_v, rawExpr='$display_node($section.sections)')) # from line 95, col 7. write(''' ''') write(''' \t\t
\t
''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" def main_content(self, **KWS): ## CHEETAH: generated from #block main_content at line 24, 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 self._CHEETAH__globalSetVars["section_cnt"] = 0 self._CHEETAH__globalSetVars["row_classes"] = ("table_row_even", "table_row_odd") self._CHEETAH__globalSetVars["entry_value_classes"] = ("section_alert_entry_value_normal", "section_alert_entry_value_emphasis") write('''
''') _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"sections",True)) # '$display_node($sections)' on line 105, col 1 if _v is not None: write(_filter(_v, rawExpr='$display_node($sections)')) # from line 105, col 1. 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) ######################################## ## 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_MessageSummary= 'writeBody' ## END CLASS DEFINITION if not hasattr(MessageSummary, '_initCheetahAttributes'): templateAPIClass = getattr(MessageSummary, '_CHEETAH_templateClass', Template) templateAPIClass._addCheetahPlumbingCodeToClass(MessageSummary) # 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=MessageSummary()).run()