~ubuntu-branches/ubuntu/utopic/prewikka/utopic

« back to all changes in this revision

Viewing changes to prewikka/templates/HeartbeatListing.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.6888311
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.812758
 
38
__CHEETAH_genTimestamp__ = 'Tue Sep  8 11:23:36 2009'
35
39
__CHEETAH_src__ = 'prewikka/templates/HeartbeatListing.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(HeartbeatListing, self).__init__(*args, **KWs)
 
60
        MessageListing.__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
 
        _orig_filter_16467428 = _filter
85
 
        filterName = u'CleanOutput'
 
88
        _orig_filter_79999812 = _filter
 
89
        filterName = 'CleanOutput'
86
90
        if self._CHEETAH__filters.has_key("CleanOutput"):
87
91
            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
88
92
        else:
89
93
            _filter = self._CHEETAH__currentFilter = \
90
94
                        self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
91
 
        write(u'''
 
95
        write('''
92
96
''')
93
97
        self._CHEETAH__globalSetVars["cnt"] = 0
94
 
        write(u'''
 
98
        write('''
95
99
<thead>
96
100
<tr>
97
101
<td class="filtered_column">
98
102
  <div>''')
99
103
        if False:
100
104
            _("Agent")
101
 
        _v = VFFSL(SL,"_",False)("Agent") # u'$_("Agent")' on line 11, col 8
102
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Agent")')) # from line 11, col 8.
103
 
        write(u'''</div>
 
105
        _v = VFFSL(SL,"_",False)("Agent") # '$_("Agent")' on line 11, col 8
 
106
        if _v is not None: write(_filter(_v, rawExpr='$_("Agent")')) # from line 11, col 8.
 
107
        write('''</div>
104
108
''')
105
109
        if VFFSL(SL,"name_filtered",True): # generated from line 12, col 3
106
 
            write(u'''    <span>*</span>
 
110
            write('''    <span>*</span>
107
111
''')
108
 
        write(u'''</td>
 
112
        write('''</td>
109
113
 
110
114
<td class="filtered_column">
111
115
  <div>''')
112
116
        if False:
113
117
            _("Node address")
114
 
        _v = VFFSL(SL,"_",False)("Node address") # u'$_("Node address")' on line 18, col 8
115
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Node address")')) # from line 18, col 8.
116
 
        write(u'''</div>
 
118
        _v = VFFSL(SL,"_",False)("Node address") # '$_("Node address")' on line 18, col 8
 
119
        if _v is not None: write(_filter(_v, rawExpr='$_("Node address")')) # from line 18, col 8.
 
120
        write('''</div>
117
121
''')
118
122
        if VFFSL(SL,"address_filtered",True): # generated from line 19, col 3
119
 
            write(u'''    <span>*</span>
 
123
            write('''    <span>*</span>
120
124
''')
121
 
        write(u'''</td>
 
125
        write('''</td>
122
126
 
123
127
<td class="filtered_column">
124
128
  <div>''')
125
129
        if False:
126
130
            _("Node name")
127
 
        _v = VFFSL(SL,"_",False)("Node name") # u'$_("Node name")' on line 25, col 8
128
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Node name")')) # from line 25, col 8.
129
 
        write(u'''</div>
 
131
        _v = VFFSL(SL,"_",False)("Node name") # '$_("Node name")' on line 25, col 8
 
132
        if _v is not None: write(_filter(_v, rawExpr='$_("Node name")')) # from line 25, col 8.
 
133
        write('''</div>
130
134
''')
131
135
        if VFFSL(SL,"node_name_filtered",True): # generated from line 26, col 3
132
 
            write(u'''    <span>*</span>
 
136
            write('''    <span>*</span>
133
137
''')
134
 
        write(u'''</td>
 
138
        write('''</td>
135
139
 
136
140
<td class="filtered_column">
137
141
  <div>''')
138
142
        if False:
139
143
            _("Model")
140
 
        _v = VFFSL(SL,"_",False)("Model") # u'$_("Model")' on line 32, col 8
141
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Model")')) # from line 32, col 8.
142
 
        write(u'''</div>
 
144
        _v = VFFSL(SL,"_",False)("Model") # '$_("Model")' on line 32, col 8
 
145
        if _v is not None: write(_filter(_v, rawExpr='$_("Model")')) # from line 32, col 8.
 
146
        write('''</div>
143
147
''')
144
148
        if VFFSL(SL,"model_filtered",True): # generated from line 33, col 3
145
 
            write(u'''    <span>*</span>
 
149
            write('''    <span>*</span>
146
150
''')
147
 
        write(u'''</td>
 
151
        write('''</td>
148
152
 
149
153
<td>''')
150
154
        if False:
151
155
            _("Time")
152
 
        _v = VFFSL(SL,"_",False)("Time") # u'$_("Time")' on line 38, col 5
153
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Time")')) # from line 38, col 5.
154
 
        write(u'''</td>
 
156
        _v = VFFSL(SL,"_",False)("Time") # '$_("Time")' on line 38, col 5
 
157
        if _v is not None: write(_filter(_v, rawExpr='$_("Time")')) # from line 38, col 5.
 
158
        write('''</td>
155
159
<td>&nbsp;</td>
156
160
</tr>
157
161
 
158
162
</thead>
159
163
''')
160
 
        _filter = self._CHEETAH__currentFilter = _orig_filter_16467428
 
164
        _filter = self._CHEETAH__currentFilter = _orig_filter_79999812
161
165
        
162
166
        ########################################
163
167
        ## END - generated method body
184
188
        ########################################
185
189
        ## START - generated method body
186
190
        
187
 
        write(u'''
 
191
        write('''
188
192
<td>
189
193
  <a class="popup_menu_toggle" href="#">''')
190
 
        _v = VFFSL(SL,"message.agent.value",True) # u'$message.agent.value' on line 49, col 41
191
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.agent.value')) # from line 49, col 41.
192
 
        write(u'''</a>
 
194
        _v = VFFSL(SL,"message.agent.value",True) # '$message.agent.value' on line 49, col 41
 
195
        if _v is not None: write(_filter(_v, rawExpr='$message.agent.value')) # from line 49, col 41.
 
196
        write('''</a>
193
197
  <span class="popup_menu">
194
198
   - <a href="''')
195
 
        _v = VFFSL(SL,"message.summary",True) # u'$message.summary' on line 51, col 15
196
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.summary')) # from line 51, col 15.
197
 
        write(u'''">''')
 
199
        _v = VFFSL(SL,"message.summary",True) # '$message.summary' on line 51, col 15
 
200
        if _v is not None: write(_filter(_v, rawExpr='$message.summary')) # from line 51, col 15.
 
201
        write('''">''')
198
202
        if False:
199
203
            _("Heartbeat summary")
200
 
        _v = VFFSL(SL,"_",False)("Heartbeat summary") # u'$_("Heartbeat summary")' on line 51, col 33
201
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Heartbeat summary")')) # from line 51, col 33.
202
 
        write(u'''</a><br />
 
204
        _v = VFFSL(SL,"_",False)("Heartbeat summary") # '$_("Heartbeat summary")' on line 51, col 33
 
205
        if _v is not None: write(_filter(_v, rawExpr='$_("Heartbeat summary")')) # from line 51, col 33.
 
206
        write('''</a><br />
203
207
   - <a href="''')
204
 
        _v = VFFSL(SL,"message.agent.inline_filter",True) # u'$message.agent.inline_filter' on line 52, col 15
205
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.agent.inline_filter')) # from line 52, col 15.
206
 
        write(u'''">''')
 
208
        _v = VFFSL(SL,"message.agent.inline_filter",True) # '$message.agent.inline_filter' on line 52, col 15
 
209
        if _v is not None: write(_filter(_v, rawExpr='$message.agent.inline_filter')) # from line 52, col 15.
 
210
        write('''">''')
207
211
        if False:
208
212
            _("Filter on agent")
209
 
        _v = VFFSL(SL,"_",False)("Filter on agent") # u'$_("Filter on agent")' on line 52, col 45
210
 
        if _v is not None: write(_filter(_v, rawExpr=u'$_("Filter on agent")')) # from line 52, col 45.
211
 
        write(u'''</a>
 
213
        _v = VFFSL(SL,"_",False)("Filter on agent") # '$_("Filter on agent")' on line 52, col 45
 
214
        if _v is not None: write(_filter(_v, rawExpr='$_("Filter on agent")')) # from line 52, col 45.
 
215
        write('''</a>
212
216
  </span>
213
217
</td>
214
218
 
216
220
''')
217
221
        if len(VFFSL(SL,"message.node_addresses",True)) > 0: # generated from line 57, col 3
218
222
            for address in VFFSL(SL,"message.node_addresses",True): # generated from line 58, col 5
219
 
                write(u'''    <a class="popup_menu_toggle" href="#">''')
220
 
                _v = VFFSL(SL,"address.value",True) # u'$address.value' on line 59, col 43
221
 
                if _v is not None: write(_filter(_v, rawExpr=u'$address.value')) # from line 59, col 43.
222
 
                write(u'''</a>
 
223
                write('''    <a class="popup_menu_toggle" href="#">''')
 
224
                _v = VFFSL(SL,"address.value",True) # '$address.value' on line 59, col 43
 
225
                if _v is not None: write(_filter(_v, rawExpr='$address.value')) # from line 59, col 43.
 
226
                write('''</a>
223
227
    <span class="popup_menu">
224
228
      - <a href="''')
225
 
                _v = VFFSL(SL,"address.inline_filter",True) # u'$address.inline_filter' on line 61, col 18
226
 
                if _v is not None: write(_filter(_v, rawExpr=u'$address.inline_filter')) # from line 61, col 18.
227
 
                write(u'''">''')
 
229
                _v = VFFSL(SL,"address.inline_filter",True) # '$address.inline_filter' on line 61, col 18
 
230
                if _v is not None: write(_filter(_v, rawExpr='$address.inline_filter')) # from line 61, col 18.
 
231
                write('''">''')
228
232
                if False:
229
233
                    _("Filter on address")
230
 
                _v = VFFSL(SL,"_",False)("Filter on address") # u'$_("Filter on address")' on line 61, col 42
231
 
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Filter on address")')) # from line 61, col 42.
232
 
                write(u'''</a><br />
 
234
                _v = VFFSL(SL,"_",False)("Filter on address") # '$_("Filter on address")' on line 61, col 42
 
235
                if _v is not None: write(_filter(_v, rawExpr='$_("Filter on address")')) # from line 61, col 42.
 
236
                write('''</a><br />
233
237
      - <a target="''')
234
 
                _v = VFFSL(SL,"prewikka.external_link_target",True) # u'$prewikka.external_link_target' on line 62, col 20
235
 
                if _v is not None: write(_filter(_v, rawExpr=u'$prewikka.external_link_target')) # from line 62, col 20.
236
 
                write(u'''" href="https://www.prelude-ids.com/host_details.php?host=''')
237
 
                _v = VFFSL(SL,"address.value",True) # u'$address.value' on line 62, col 108
238
 
                if _v is not None: write(_filter(_v, rawExpr=u'$address.value')) # from line 62, col 108.
239
 
                write(u'''">Address information</a><br />
 
238
                _v = VFFSL(SL,"prewikka.external_link_target",True) # '$prewikka.external_link_target' on line 62, col 20
 
239
                if _v is not None: write(_filter(_v, rawExpr='$prewikka.external_link_target')) # from line 62, col 20.
 
240
                write('''" href="https://www.prelude-ids.com/host_details.php?host=''')
 
241
                _v = VFFSL(SL,"address.value",True) # '$address.value' on line 62, col 108
 
242
                if _v is not None: write(_filter(_v, rawExpr='$address.value')) # from line 62, col 108.
 
243
                write('''">Address information</a><br />
240
244
''')
241
245
                for name, link in VFFSL(SL,"address.host_commands",True): # generated from line 63, col 7
242
 
                    write(u'''      - <a href="''')
243
 
                    _v = VFFSL(SL,"link",True) # u'$link' on line 64, col 18
244
 
                    if _v is not None: write(_filter(_v, rawExpr=u'$link')) # from line 64, col 18.
245
 
                    write(u'''">''')
246
 
                    _v = VFFSL(SL,"name",True) # u'$name' on line 64, col 25
247
 
                    if _v is not None: write(_filter(_v, rawExpr=u'$name')) # from line 64, col 25.
248
 
                    write(u'''</a><br />
 
246
                    write('''      - <a href="''')
 
247
                    _v = VFFSL(SL,"link",True) # '$link' on line 64, col 18
 
248
                    if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 64, col 18.
 
249
                    write('''">''')
 
250
                    _v = VFFSL(SL,"name",True) # '$name' on line 64, col 25
 
251
                    if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 64, col 25.
 
252
                    write('''</a><br />
249
253
''')
250
 
                write(u'''    </span>
 
254
                write('''    </span>
251
255
    <br />
252
256
''')
253
257
        else: # generated from line 69, col 3
254
 
            write(u'''    n/a
 
258
            write('''    n/a
255
259
''')
256
 
        write(u'''</td>
 
260
        write('''</td>
257
261
 
258
262
<td>
259
263
 <a href="''')
260
 
        _v = VFFSL(SL,"message.node_name.inline_filter",True) # u'$message.node_name.inline_filter' on line 75, col 11
261
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.node_name.inline_filter')) # from line 75, col 11.
262
 
        write(u'''">''')
263
 
        _v = VFFSL(SL,"message.node_name.value",True) # u'$message.node_name.value' on line 75, col 45
264
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.node_name.value')) # from line 75, col 45.
265
 
        write(u'''</a><br />
 
264
        _v = VFFSL(SL,"message.node_name.inline_filter",True) # '$message.node_name.inline_filter' on line 75, col 11
 
265
        if _v is not None: write(_filter(_v, rawExpr='$message.node_name.inline_filter')) # from line 75, col 11.
 
266
        write('''">''')
 
267
        _v = VFFSL(SL,"message.node_name.value",True) # '$message.node_name.value' on line 75, col 45
 
268
        if _v is not None: write(_filter(_v, rawExpr='$message.node_name.value')) # from line 75, col 45.
 
269
        write('''</a><br />
266
270
</td>
267
271
 
268
272
<td>
269
273
  <a href="''')
270
 
        _v = VFFSL(SL,"message.model.inline_filter",True) # u'$message.model.inline_filter' on line 79, col 12
271
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.model.inline_filter')) # from line 79, col 12.
272
 
        write(u'''">''')
273
 
        _v = VFFSL(SL,"message.model.value",True) # u'$message.model.value' on line 79, col 42
274
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.model.value')) # from line 79, col 42.
275
 
        write(u'''</a>
 
274
        _v = VFFSL(SL,"message.model.inline_filter",True) # '$message.model.inline_filter' on line 79, col 12
 
275
        if _v is not None: write(_filter(_v, rawExpr='$message.model.inline_filter')) # from line 79, col 12.
 
276
        write('''">''')
 
277
        _v = VFFSL(SL,"message.model.value",True) # '$message.model.value' on line 79, col 42
 
278
        if _v is not None: write(_filter(_v, rawExpr='$message.model.value')) # from line 79, col 42.
 
279
        write('''</a>
276
280
</td>
277
281
 
278
282
<td>''')
279
 
        _v = VFFSL(SL,"message.time.value",True) # u'$message.time.value' on line 82, col 5
280
 
        if _v is not None: write(_filter(_v, rawExpr=u'$message.time.value')) # from line 82, col 5.
281
 
        write(u'''</td>
 
283
        _v = VFFSL(SL,"message.time.value",True) # '$message.time.value' on line 82, col 5
 
284
        if _v is not None: write(_filter(_v, rawExpr='$message.time.value')) # from line 82, col 5.
 
285
        write('''</td>
282
286
 
283
287
''')
284
288
        self._CHEETAH__globalSetVars["cnt"] += 1
308
312
        ########################################
309
313
        ## START - generated method body
310
314
        
311
 
        write(u'''
 
315
        write('''
312
316
''')
313
317
        self.message_fields_header(trans=trans)
314
 
        write(u'''
 
318
        write('''
315
319
''')
316
320
        self.message_fields(trans=trans)
317
321