~ubuntu-branches/ubuntu/vivid/prewikka/vivid

« back to all changes in this revision

Viewing changes to prewikka/templates/HeartbeatAnalyze.py

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-12-31 02:18:56 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091231021856-fkctle2rfpw0z8ei
Tags: 0.9.17.1-1ubuntu1
Append --prefix=/usr to setup.py install to install all modules into
the right path.

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__
12
11
from os.path import getmtime, exists
13
12
import time
14
13
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 *
 
18
from Cheetah.DummyTransaction import DummyTransaction
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)
27
31
VFFSL=valueFromFrameOrSearchList
28
32
VFSL=valueFromSearchList
29
33
VFN=valueForName
30
34
currentTime=time.time
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'
 
35
__CHEETAH_version__ = '2.0.1'
 
36
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
 
37
__CHEETAH_genTime__ = 1252401816.838763
 
38
__CHEETAH_genTimestamp__ = 'Tue Sep  8 11:23:36 2009'
35
39
__CHEETAH_src__ = 'prewikka/templates/HeartbeatAnalyze.tmpl'
36
40
__CHEETAH_srcLastModified__ = 'Tue May  5 16:55:59 2009'
37
 
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
 
41
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
38
42
 
39
43
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
40
44
    raise AssertionError(
53
57
 
54
58
    def __init__(self, *args, **KWs):
55
59
 
56
 
        super(HeartbeatAnalyze, self).__init__(*args, **KWs)
 
60
        ClassicLayout.__init__(self, *args, **KWs)
57
61
        if not self._CHEETAH__instanceInitialized:
58
62
            cheetahKWArgs = {}
59
63
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
81
85
        ########################################
82
86
        ## START - generated method body
83
87
        
84
 
        write(u'''<table class="heartbeat_analyze">
 
88
        write('''<table class="heartbeat_analyze">
85
89
  <thead>
86
90
    <tr class="heartbeat_analyze_header">
87
91
      <td>Name</td>
99
103
''')
100
104
        row_classes = ("table_row_even", "table_row_odd")
101
105
        cnt = 0
102
 
        write(u'''  
 
106
        write('''  
103
107
  <tr class="''')
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>
 
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>
133
137
    <td>
134
138
''')
135
139
        if len(VFFSL(SL,"analyzer.node_addresses",True)) > 0: # generated from line 29, col 7
136
140
            for address in VFFSL(SL,"analyzer.node_addresses",True): # generated from line 30, col 9
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/>
 
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/>
141
145
''')
142
146
        else: # generated from line 33, col 7
143
 
            write(u'''        n/a
 
147
            write('''        n/a
144
148
''')
145
 
        write(u'''    </td>
 
149
        write('''    </td>
146
150
    <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>
 
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>
150
154
    <td class="heartbeat_analyze_sensor_status_''')
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'''">
 
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('''">
154
158
      <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>
 
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>
158
162
    </td>
159
163
  </tr>
160
164
''')
161
165
        cnt += 1
162
 
        write(u''' </tbody>
 
166
        write(''' </tbody>
163
167
</table>
164
168
  
165
169
<table class="heartbeat_analyze">
172
176
        row_classes = ("table_row_even", "table_row_odd")
173
177
        cnt = 0
174
178
        for event in VFFSL(SL,"analyzer.events",True): # generated from line 54, col 5
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>
 
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>
185
189
''')
186
190
            cnt += 1
187
 
        write(u'''  </tbody>
 
191
        write('''  </tbody>
188
192
</table>
189
193
''')
190
194
        
213
217
        ########################################
214
218
        ## START - generated method body
215
219
        
216
 
        write(u'''
 
220
        write('''
217
221
''')
218
222
        self.main_content(trans=trans)
219
223