~ubuntu-branches/ubuntu/maverick/prewikka/maverick

« back to all changes in this revision

Viewing changes to prewikka/templates/HeartbeatAnalyze.py

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-07-06 08:39:07 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090706083907-59qlpova8dvyvm8a
Tags: 0.9.16-1ubuntu1
* Merge from debian unstable, Ubuntu remaining changes:
  - Append --install-layout=deb to setup.py install arguments.
* debian/control:
  - Bump python-all-dev, python-central, debhelper build dependencies as
    per Debian Python New Policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import sys
9
9
import os
10
10
import os.path
 
11
import __builtin__
11
12
from os.path import getmtime, exists
12
13
import time
13
14
import types
14
 
import __builtin__
15
15
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
16
16
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
17
17
from Cheetah.Template import Template
18
 
from Cheetah.DummyTransaction import DummyTransaction
 
18
from Cheetah.DummyTransaction import *
19
19
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
20
20
from Cheetah.CacheRegion import CacheRegion
21
21
import Cheetah.Filters as Filters
24
24
 
25
25
##################################################
26
26
## MODULE CONSTANTS
27
 
try:
28
 
    True, False
29
 
except NameError:
30
 
    True, False = (1==1), (1==0)
31
27
VFFSL=valueFromFrameOrSearchList
32
28
VFSL=valueFromSearchList
33
29
VFN=valueForName
34
30
currentTime=time.time
35
 
__CHEETAH_version__ = '2.0.1'
36
 
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
37
 
__CHEETAH_genTime__ = 1244966471.1638229
38
 
__CHEETAH_genTimestamp__ = 'Sun Jun 14 10:01:11 2009'
 
31
__CHEETAH_version__ = '2.2.1'
 
32
__CHEETAH_versionTuple__ = (2, 2, 1, 'final', 0)
 
33
__CHEETAH_genTime__ = 1244715457.758189
 
34
__CHEETAH_genTimestamp__ = 'Thu Jun 11 12:17:37 2009'
39
35
__CHEETAH_src__ = 'prewikka/templates/HeartbeatAnalyze.tmpl'
40
36
__CHEETAH_srcLastModified__ = 'Tue May  5 16:55:59 2009'
41
 
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
 
37
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
42
38
 
43
39
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
44
40
    raise AssertionError(
57
53
 
58
54
    def __init__(self, *args, **KWs):
59
55
 
60
 
        ClassicLayout.__init__(self, *args, **KWs)
 
56
        super(HeartbeatAnalyze, self).__init__(*args, **KWs)
61
57
        if not self._CHEETAH__instanceInitialized:
62
58
            cheetahKWArgs = {}
63
59
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
85
81
        ########################################
86
82
        ## START - generated method body
87
83
        
88
 
        write('''<table class="heartbeat_analyze">
 
84
        write(u'''<table class="heartbeat_analyze">
89
85
  <thead>
90
86
    <tr class="heartbeat_analyze_header">
91
87
      <td>Name</td>
103
99
''')
104
100
        row_classes = ("table_row_even", "table_row_odd")
105
101
        cnt = 0
106
 
        write('''  
 
102
        write(u'''  
107
103
  <tr class="''')
108
 
        _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 22, col 14
109
 
        if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 22, col 14.
110
 
        write('''">
111
 
    <td>''')
112
 
        _v = VFFSL(SL,"analyzer.name",True) # '$analyzer.name' on line 23, col 9
113
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.name')) # from line 23, col 9.
114
 
        write('''</td>
115
 
    <td>''')
116
 
        _v = VFFSL(SL,"analyzer.model",True) # '$analyzer.model' on line 24, col 9
117
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.model')) # from line 24, col 9.
118
 
        write(''' ''')
119
 
        _v = VFFSL(SL,"analyzer.version",True) # '$analyzer.version' on line 24, col 25
120
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.version')) # from line 24, col 25.
121
 
        write('''</td>
122
 
    <td>''')
123
 
        _v = VFFSL(SL,"analyzer.ostype",True) # '$analyzer.ostype' on line 25, col 9
124
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.ostype')) # from line 25, col 9.
125
 
        write(''' ''')
126
 
        _v = VFFSL(SL,"analyzer.osversion",True) # '$analyzer.osversion' on line 25, col 26
127
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.osversion')) # from line 25, col 26.
128
 
        write('''</td>
129
 
    <td>''')
130
 
        _v = VFFSL(SL,"analyzer.node_name",True) # '$analyzer.node_name' on line 26, col 9
131
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.node_name')) # from line 26, col 9.
132
 
        write('''</td>
133
 
    <td>''')
134
 
        _v = VFFSL(SL,"analyzer.node_location",True) # '$analyzer.node_location' on line 27, col 9
135
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.node_location')) # from line 27, col 9.
136
 
        write('''</td>
 
104
        _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 22, col 14
 
105
        if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 22, col 14.
 
106
        write(u'''">
 
107
    <td>''')
 
108
        _v = VFFSL(SL,"analyzer.name",True) # u'$analyzer.name' on line 23, col 9
 
109
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.name')) # from line 23, col 9.
 
110
        write(u'''</td>
 
111
    <td>''')
 
112
        _v = VFFSL(SL,"analyzer.model",True) # u'$analyzer.model' on line 24, col 9
 
113
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.model')) # from line 24, col 9.
 
114
        write(u''' ''')
 
115
        _v = VFFSL(SL,"analyzer.version",True) # u'$analyzer.version' on line 24, col 25
 
116
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.version')) # from line 24, col 25.
 
117
        write(u'''</td>
 
118
    <td>''')
 
119
        _v = VFFSL(SL,"analyzer.ostype",True) # u'$analyzer.ostype' on line 25, col 9
 
120
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.ostype')) # from line 25, col 9.
 
121
        write(u''' ''')
 
122
        _v = VFFSL(SL,"analyzer.osversion",True) # u'$analyzer.osversion' on line 25, col 26
 
123
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.osversion')) # from line 25, col 26.
 
124
        write(u'''</td>
 
125
    <td>''')
 
126
        _v = VFFSL(SL,"analyzer.node_name",True) # u'$analyzer.node_name' on line 26, col 9
 
127
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.node_name')) # from line 26, col 9.
 
128
        write(u'''</td>
 
129
    <td>''')
 
130
        _v = VFFSL(SL,"analyzer.node_location",True) # u'$analyzer.node_location' on line 27, col 9
 
131
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.node_location')) # from line 27, col 9.
 
132
        write(u'''</td>
137
133
    <td>
138
134
''')
139
135
        if len(VFFSL(SL,"analyzer.node_addresses",True)) > 0: # generated from line 29, col 7
140
136
            for address in VFFSL(SL,"analyzer.node_addresses",True): # generated from line 30, col 9
141
 
                write('''          ''')
142
 
                _v = VFFSL(SL,"address",True) # '$address' on line 31, col 11
143
 
                if _v is not None: write(_filter(_v, rawExpr='$address')) # from line 31, col 11.
144
 
                write('''<br/>
 
137
                write(u'''          ''')
 
138
                _v = VFFSL(SL,"address",True) # u'$address' on line 31, col 11
 
139
                if _v is not None: write(_filter(_v, rawExpr=u'$address')) # from line 31, col 11.
 
140
                write(u'''<br/>
145
141
''')
146
142
        else: # generated from line 33, col 7
147
 
            write('''        n/a
 
143
            write(u'''        n/a
148
144
''')
149
 
        write('''    </td>
 
145
        write(u'''    </td>
150
146
    <td>''')
151
 
        _v = VFFSL(SL,"analyzer.last_heartbeat_time",True) # '$analyzer.last_heartbeat_time' on line 37, col 9
152
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.last_heartbeat_time')) # from line 37, col 9.
153
 
        write('''</td>
 
147
        _v = VFFSL(SL,"analyzer.last_heartbeat_time",True) # u'$analyzer.last_heartbeat_time' on line 37, col 9
 
148
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.last_heartbeat_time')) # from line 37, col 9.
 
149
        write(u'''</td>
154
150
    <td class="heartbeat_analyze_sensor_status_''')
155
 
        _v = VFFSL(SL,"analyzer.status",True) # '$analyzer.status' on line 38, col 48
156
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.status')) # from line 38, col 48.
157
 
        write('''">
 
151
        _v = VFFSL(SL,"analyzer.status",True) # u'$analyzer.status' on line 38, col 48
 
152
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.status')) # from line 38, col 48.
 
153
        write(u'''">
158
154
      <b>''')
159
 
        _v = VFFSL(SL,"analyzer.status_meaning",True) # '$analyzer.status_meaning' on line 39, col 10
160
 
        if _v is not None: write(_filter(_v, rawExpr='$analyzer.status_meaning')) # from line 39, col 10.
161
 
        write('''</b>
 
155
        _v = VFFSL(SL,"analyzer.status_meaning",True) # u'$analyzer.status_meaning' on line 39, col 10
 
156
        if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.status_meaning')) # from line 39, col 10.
 
157
        write(u'''</b>
162
158
    </td>
163
159
  </tr>
164
160
''')
165
161
        cnt += 1
166
 
        write(''' </tbody>
 
162
        write(u''' </tbody>
167
163
</table>
168
164
  
169
165
<table class="heartbeat_analyze">
176
172
        row_classes = ("table_row_even", "table_row_odd")
177
173
        cnt = 0
178
174
        for event in VFFSL(SL,"analyzer.events",True): # generated from line 54, col 5
179
 
            write('''      <tr class="''')
180
 
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 55, col 18
181
 
            if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 55, col 18.
182
 
            write('''"><td colspan="8" class="heartbeat_analyzer_event_''')
183
 
            _v = VFFSL(SL,"event.type",True) # '$event.type' on line 55, col 88
184
 
            if _v is not None: write(_filter(_v, rawExpr='$event.type')) # from line 55, col 88.
185
 
            write('''">''')
186
 
            _v = VFFSL(SL,"event.value",True) # '$event.value' on line 55, col 101
187
 
            if _v is not None: write(_filter(_v, rawExpr='$event.value')) # from line 55, col 101.
188
 
            write('''</td></tr>
 
175
            write(u'''      <tr class="''')
 
176
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 55, col 18
 
177
            if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 55, col 18.
 
178
            write(u'''"><td colspan="8" class="heartbeat_analyzer_event_''')
 
179
            _v = VFFSL(SL,"event.type",True) # u'$event.type' on line 55, col 88
 
180
            if _v is not None: write(_filter(_v, rawExpr=u'$event.type')) # from line 55, col 88.
 
181
            write(u'''">''')
 
182
            _v = VFFSL(SL,"event.value",True) # u'$event.value' on line 55, col 101
 
183
            if _v is not None: write(_filter(_v, rawExpr=u'$event.value')) # from line 55, col 101.
 
184
            write(u'''</td></tr>
189
185
''')
190
186
            cnt += 1
191
 
        write('''  </tbody>
 
187
        write(u'''  </tbody>
192
188
</table>
193
189
''')
194
190
        
217
213
        ########################################
218
214
        ## START - generated method body
219
215
        
220
 
        write('''
 
216
        write(u'''
221
217
''')
222
218
        self.main_content(trans=trans)
223
219