~ubuntu-branches/ubuntu/intrepid/prewikka/intrepid

« back to all changes in this revision

Viewing changes to prewikka/templates/SensorAlertListing.py

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2007-04-11 14:41:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070411144109-2hh7zx3amwd27b4l
Tags: upstream-0.9.10
ImportĀ upstreamĀ versionĀ 0.9.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
 
 
4
 
 
5
 
 
6
##################################################
 
7
## DEPENDENCIES
 
8
import sys
 
9
import os
 
10
import os.path
 
11
from os.path import getmtime, exists
 
12
import time
 
13
import types
 
14
import __builtin__
 
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.utils import utils
 
24
from prewikka.templates.AlertListing import AlertListing
 
25
 
 
26
##################################################
 
27
## MODULE CONSTANTS
 
28
try:
 
29
    True, False
 
30
except NameError:
 
31
    True, False = (1==1), (1==0)
 
32
VFFSL=valueFromFrameOrSearchList
 
33
VFSL=valueFromSearchList
 
34
VFN=valueForName
 
35
currentTime=time.time
 
36
__CHEETAH_version__ = '2.0rc7'
 
37
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 7)
 
38
__CHEETAH_genTime__ = 1166283668.600498
 
39
__CHEETAH_genTimestamp__ = 'Sat Dec 16 16:41:08 2006'
 
40
__CHEETAH_src__ = 'prewikka/templates/SensorAlertListing.tmpl'
 
41
__CHEETAH_srcLastModified__ = 'Fri Dec 15 10:49:19 2006'
 
42
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
 
43
 
 
44
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
 
45
    raise AssertionError(
 
46
      'This template was compiled with Cheetah version'
 
47
      ' %s. Templates compiled before version %s must be recompiled.'%(
 
48
         __CHEETAH_version__, RequiredCheetahVersion))
 
49
 
 
50
##################################################
 
51
## CLASSES
 
52
 
 
53
class SensorAlertListing(AlertListing):
 
54
 
 
55
    ##################################################
 
56
    ## CHEETAH GENERATED METHODS
 
57
 
 
58
 
 
59
    def __init__(self, *args, **KWs):
 
60
 
 
61
        AlertListing.__init__(self, *args, **KWs)
 
62
        if not self._CHEETAH__instanceInitialized:
 
63
            cheetahKWArgs = {}
 
64
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
 
65
            for k,v in KWs.items():
 
66
                if k in allowedKWs: cheetahKWArgs[k] = v
 
67
            self._initCheetahInstance(**cheetahKWArgs)
 
68
        
 
69
 
 
70
    def message_listing_header(self, **KWS):
 
71
 
 
72
 
 
73
 
 
74
        ## CHEETAH: generated from #def message_listing_header() at line 4, col 1.
 
75
        trans = KWS.get("trans")
 
76
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
 
77
            trans = self.transaction # is None unless self.awake() was called
 
78
        if not trans:
 
79
            trans = DummyTransaction()
 
80
            _dummyTrans = True
 
81
        else: _dummyTrans = False
 
82
        write = trans.response().write
 
83
        SL = self._CHEETAH__searchList
 
84
        _filter = self._CHEETAH__currentFilter
 
85
        
 
86
        ########################################
 
87
        ## START - generated method body
 
88
        
 
89
        _v = VFN(VFFSL(SL,"utils",False)(),"display_analyzer",False)(VFFSL(SL,"analyzer_infos",True)) # '$utils().display_analyzer($analyzer_infos)' on line 5, col 1
 
90
        if _v is not None: write(_filter(_v, rawExpr='$utils().display_analyzer($analyzer_infos)')) # from line 5, col 1.
 
91
        write('\n<br/>\n')
 
92
        
 
93
        ########################################
 
94
        ## END - generated method body
 
95
        
 
96
        return _dummyTrans and trans.response().getvalue() or ""
 
97
        
 
98
 
 
99
    def writeBody(self, **KWS):
 
100
 
 
101
 
 
102
 
 
103
        ## CHEETAH: main method generated for this template
 
104
        trans = KWS.get("trans")
 
105
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
 
106
            trans = self.transaction # is None unless self.awake() was called
 
107
        if not trans:
 
108
            trans = DummyTransaction()
 
109
            _dummyTrans = True
 
110
        else: _dummyTrans = False
 
111
        write = trans.response().write
 
112
        SL = self._CHEETAH__searchList
 
113
        _filter = self._CHEETAH__currentFilter
 
114
        
 
115
        ########################################
 
116
        ## START - generated method body
 
117
        
 
118
        write('\n')
 
119
        
 
120
        ########################################
 
121
        ## END - generated method body
 
122
        
 
123
        return _dummyTrans and trans.response().getvalue() or ""
 
124
        
 
125
    ##################################################
 
126
    ## CHEETAH GENERATED ATTRIBUTES
 
127
 
 
128
 
 
129
    _CHEETAH__instanceInitialized = False
 
130
 
 
131
    _CHEETAH_version = __CHEETAH_version__
 
132
 
 
133
    _CHEETAH_versionTuple = __CHEETAH_versionTuple__
 
134
 
 
135
    _CHEETAH_genTime = __CHEETAH_genTime__
 
136
 
 
137
    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
 
138
 
 
139
    _CHEETAH_src = __CHEETAH_src__
 
140
 
 
141
    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
 
142
 
 
143
    _mainCheetahMethod_for_SensorAlertListing= 'writeBody'
 
144
 
 
145
## END CLASS DEFINITION
 
146
 
 
147
if not hasattr(SensorAlertListing, '_initCheetahAttributes'):
 
148
    templateAPIClass = getattr(SensorAlertListing, '_CHEETAH_templateClass', Template)
 
149
    templateAPIClass._addCheetahPlumbingCodeToClass(SensorAlertListing)
 
150
 
 
151
 
 
152
# CHEETAH was developed by Tavis Rudd and Mike Orr
 
153
# with code, advice and input from many other volunteers.
 
154
# For more information visit http://www.CheetahTemplate.org/
 
155
 
 
156
##################################################
 
157
## if run from command line:
 
158
if __name__ == '__main__':
 
159
    from Cheetah.TemplateCmdLineIface import CmdLineIface
 
160
    CmdLineIface(templateObj=SensorAlertListing()).run()
 
161
 
 
162