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

« back to all changes in this revision

Viewing changes to prewikka/templates/MessageSummary.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__ = 1244715456.6442299
34
 
__CHEETAH_genTimestamp__ = 'Thu Jun 11 12:17:36 2009'
 
35
__CHEETAH_version__ = '2.0.1'
 
36
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
 
37
__CHEETAH_genTime__ = 1252401818.0831201
 
38
__CHEETAH_genTimestamp__ = 'Tue Sep  8 11:23:38 2009'
35
39
__CHEETAH_src__ = 'prewikka/templates/MessageSummary.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(MessageSummary, 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'''<script type="text/javascript">
 
88
        write('''<script type="text/javascript">
85
89
<!--
86
90
$(document).ready(function() {
87
91
 
126
130
        ########################################
127
131
        ## START - generated method body
128
132
        
129
 
        write(u'''
 
133
        write('''
130
134
''')
131
135
        table_cnt = 0
132
136
        for table in VFFSL(SL,"section.tables",True): # generated from line 32, col 3
133
 
            write(u'''\t\t
 
137
            write('''\t\t
134
138
''')
135
139
            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
136
 
                write(u'''\t\t  <br/>
 
140
                write('''\t\t  <br/>
137
141
''')
138
 
            write(u'''
 
142
            write('''
139
143
''')
140
144
            if VFFSL(SL,"table.odd_even",True): # generated from line 38, col 17
141
 
                write(u'''\t\t<table class="''')
142
 
                _v = VFFSL(SL,"table.class",True) # u'$table.class' on line 39, col 17
143
 
                if _v is not None: write(_filter(_v, rawExpr=u'$table.class')) # from line 39, col 17.
144
 
                write(u''' ''')
145
 
                _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"table_cnt",True) % 2] # u'$row_classes[$table_cnt % 2]' on line 39, col 30
146
 
                if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$table_cnt % 2]')) # from line 39, col 30.
147
 
                write(u'''" style="''')
148
 
                _v = VFFSL(SL,"table.style",True) # u'$table.style' on line 39, col 67
149
 
                if _v is not None: write(_filter(_v, rawExpr=u'$table.style')) # from line 39, col 67.
150
 
                write(u'''">
 
145
                write('''\t\t<table class="''')
 
146
                _v = VFFSL(SL,"table.class",True) # '$table.class' on line 39, col 17
 
147
                if _v is not None: write(_filter(_v, rawExpr='$table.class')) # from line 39, col 17.
 
148
                write(''' ''')
 
149
                _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"table_cnt",True) % 2] # '$row_classes[$table_cnt % 2]' on line 39, col 30
 
150
                if _v is not None: write(_filter(_v, rawExpr='$row_classes[$table_cnt % 2]')) # from line 39, col 30.
 
151
                write('''" style="''')
 
152
                _v = VFFSL(SL,"table.style",True) # '$table.style' on line 39, col 67
 
153
                if _v is not None: write(_filter(_v, rawExpr='$table.style')) # from line 39, col 67.
 
154
                write('''">
151
155
''')
152
156
            else: # generated from line 40, col 3
153
 
                write(u'''\t\t<table class="''')
154
 
                _v = VFFSL(SL,"table.class",True) # u'$table.class' on line 41, col 17
155
 
                if _v is not None: write(_filter(_v, rawExpr=u'$table.class')) # from line 41, col 17.
156
 
                write(u'''" style="''')
157
 
                _v = VFFSL(SL,"table.style",True) # u'$table.style' on line 41, col 38
158
 
                if _v is not None: write(_filter(_v, rawExpr=u'$table.style')) # from line 41, col 38.
159
 
                write(u'''">
 
157
                write('''\t\t<table class="''')
 
158
                _v = VFFSL(SL,"table.class",True) # '$table.class' on line 41, col 17
 
159
                if _v is not None: write(_filter(_v, rawExpr='$table.class')) # from line 41, col 17.
 
160
                write('''" style="''')
 
161
                _v = VFFSL(SL,"table.style",True) # '$table.style' on line 41, col 38
 
162
                if _v is not None: write(_filter(_v, rawExpr='$table.style')) # from line 41, col 38.
 
163
                write('''">
160
164
''')
161
 
            write(u'''
 
165
            write('''
162
166
''')
163
167
            table_cnt += 1
164
168
            row_class = ""
165
169
            for row in VFFSL(SL,"table.rows",True): # generated from line 46, col 4
166
 
                write(u'''\t\t  <tr class="''')
167
 
                _v = VFFSL(SL,"row_class",True) # u'$row_class' on line 47, col 16
168
 
                if _v is not None: write(_filter(_v, rawExpr=u'$row_class')) # from line 47, col 16.
169
 
                write(u'''" style="">
 
170
                write('''\t\t  <tr class="''')
 
171
                _v = VFFSL(SL,"row_class",True) # '$row_class' on line 47, col 16
 
172
                if _v is not None: write(_filter(_v, rawExpr='$row_class')) # from line 47, col 16.
 
173
                write('''" style="">
170
174
''')
171
175
                for col in row: # generated from line 48, col 6
172
176
                    if VFFSL(SL,"col.header",True): # generated from line 49, col 7
173
 
                        write(u'''\t\t     <th>''')
174
 
                        _v = VFFSL(SL,"col.name",True) # u'$col.name' on line 50, col 12
175
 
                        if _v is not None: write(_filter(_v, rawExpr=u'$col.name')) # from line 50, col 12.
176
 
                        write(u'''</th>
 
177
                        write('''\t\t     <th>''')
 
178
                        _v = VFFSL(SL,"col.name",True) # '$col.name' on line 50, col 12
 
179
                        if _v is not None: write(_filter(_v, rawExpr='$col.name')) # from line 50, col 12.
 
180
                        write('''</th>
177
181
''')
178
182
                        row_class = "table_row_even"
179
183
                    elif VFFSL(SL,"col.tables",True): # generated from line 52, col 7
180
 
                        write(u'''\t\t     <td>''')
181
 
                        _v = VFFSL(SL,"display_table",False)(VFFSL(SL,"col",True), VFFSL(SL,"depth",True) + 1) # u'$display_table($col, $depth + 1)' on line 53, col 12
182
 
                        if _v is not None: write(_filter(_v, rawExpr=u'$display_table($col, $depth + 1)')) # from line 53, col 12.
183
 
                        write(u'''</td>
 
184
                        write('''\t\t     <td>''')
 
185
                        _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
 
186
                        if _v is not None: write(_filter(_v, rawExpr='$display_table($col, $depth + 1)')) # from line 53, col 12.
 
187
                        write('''</td>
184
188
''')
185
189
                        row_class = ""
186
190
                    else: # generated from line 55, col 21
187
 
                        write(u'''\t\t     <td class="''')
188
 
                        _v = VFFSL(SL,"col.class",True) # u'$col.class' on line 56, col 19
189
 
                        if _v is not None: write(_filter(_v, rawExpr=u'$col.class')) # from line 56, col 19.
190
 
                        write(u'''">''')
191
 
                        _v = VFFSL(SL,"col.name",True) # u'$col.name' on line 56, col 31
192
 
                        if _v is not None: write(_filter(_v, rawExpr=u'$col.name')) # from line 56, col 31.
193
 
                        write(u'''</td>
194
 
''')
195
 
                write(u'''\t\t  </tr>
196
 
''')
197
 
            write(u'''\t\t</table>
 
191
                        write('''\t\t     <td class="''')
 
192
                        _v = VFFSL(SL,"col.class",True) # '$col.class' on line 56, col 19
 
193
                        if _v is not None: write(_filter(_v, rawExpr='$col.class')) # from line 56, col 19.
 
194
                        write('''">''')
 
195
                        _v = VFFSL(SL,"col.name",True) # '$col.name' on line 56, col 31
 
196
                        if _v is not None: write(_filter(_v, rawExpr='$col.name')) # from line 56, col 31.
 
197
                        write('''</td>
 
198
''')
 
199
                write('''\t\t  </tr>
 
200
''')
 
201
            write('''\t\t</table>
198
202
''')
199
203
        
200
204
        ########################################
223
227
        ## START - generated method body
224
228
        
225
229
        for section in VFFSL(SL,"sections",True): # generated from line 67, col 1
226
 
            write(u'''        <fieldset class="fieldset_heading">
 
230
            write('''        <fieldset class="fieldset_heading">
227
231
\t\t<legend><a href="#">''')
228
 
            _v = VFFSL(SL,"section.title",True) # u'$section.title' on line 69, col 23
229
 
            if _v is not None: write(_filter(_v, rawExpr=u'$section.title')) # from line 69, col 23.
230
 
            write(u'''</a></legend>
 
232
            _v = VFFSL(SL,"section.title",True) # '$section.title' on line 69, col 23
 
233
            if _v is not None: write(_filter(_v, rawExpr='$section.title')) # from line 69, col 23.
 
234
            write('''</a></legend>
231
235
\t\t<div style="display: ''')
232
 
            _v = VFFSL(SL,"section.display",True) # u'$section.display' on line 70, col 24
233
 
            if _v is not None: write(_filter(_v, rawExpr=u'$section.display')) # from line 70, col 24.
234
 
            write(u'''; width: 100%;">
 
236
            _v = VFFSL(SL,"section.display",True) # '$section.display' on line 70, col 24
 
237
            if _v is not None: write(_filter(_v, rawExpr='$section.display')) # from line 70, col 24.
 
238
            write('''; width: 100%;">
235
239
\t\t''')
236
 
            _v = VFFSL(SL,"display_table",False)(VFFSL(SL,"section",True), 0) # u'$display_table($section, 0)' on line 71, col 3
237
 
            if _v is not None: write(_filter(_v, rawExpr=u'$display_table($section, 0)')) # from line 71, col 3.
238
 
            write(u'''
 
240
            _v = VFFSL(SL,"display_table",False)(VFFSL(SL,"section",True), 0) # '$display_table($section, 0)' on line 71, col 3
 
241
            if _v is not None: write(_filter(_v, rawExpr='$display_table($section, 0)')) # from line 71, col 3.
 
242
            write('''
239
243
 
240
244
''')
241
245
            if VFFSL(SL,"section.entries",True): # generated from line 73, col 3
242
 
                write(u'''\t\t<table class="section_alert_entries">
 
246
                write('''\t\t<table class="section_alert_entries">
243
247
\t\t\t
244
248
''')
245
249
                cnt = 0
246
250
                for entry in VFFSL(SL,"section.entries",True): # generated from line 77, col 4
247
 
                    write(u'''
 
251
                    write('''
248
252
                             
249
253
\t\t\t\t<tr class="section_alert_entry ''')
250
 
                    _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True) % 2] # u'$row_classes[$cnt % 2]' on line 80, col 36
251
 
                    if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt % 2]')) # from line 80, col 36.
252
 
                    write(u'''">
 
254
                    _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True) % 2] # '$row_classes[$cnt % 2]' on line 80, col 36
 
255
                    if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt % 2]')) # from line 80, col 36.
 
256
                    write('''">
253
257
''')
254
258
                    if VFFSL(SL,"entry.name",True): # generated from line 81, col 19
255
 
                        write(u'''                                 <th style="text-align: left; width:150px;">''')
256
 
                        _v = VFFSL(SL,"entry.name",True) # u'$entry.name' on line 82, col 77
257
 
                        if _v is not None: write(_filter(_v, rawExpr=u'$entry.name')) # from line 82, col 77.
258
 
                        write(u'''</th>
 
259
                        write('''                                 <th style="text-align: left; width:150px;">''')
 
260
                        _v = VFFSL(SL,"entry.name",True) # '$entry.name' on line 82, col 77
 
261
                        if _v is not None: write(_filter(_v, rawExpr='$entry.name')) # from line 82, col 77.
 
262
                        write('''</th>
259
263
''')
260
 
                    write(u'''\t\t\t\t <td class="''')
261
 
                    _v = VFFSL(SL,"entry_value_classes",True)[VFFSL(SL,"entry.emphase",True)] # u'$entry_value_classes[$entry.emphase]' on line 84, col 17
262
 
                    if _v is not None: write(_filter(_v, rawExpr=u'$entry_value_classes[$entry.emphase]')) # from line 84, col 17.
263
 
                    write(u'''">''')
264
 
                    _v = VFFSL(SL,"entry.value",True) # u'$entry.value' on line 84, col 55
265
 
                    if _v is not None: write(_filter(_v, rawExpr=u'$entry.value')) # from line 84, col 55.
266
 
                    write(u'''</td>
 
264
                    write('''\t\t\t\t <td class="''')
 
265
                    _v = VFFSL(SL,"entry_value_classes",True)[VFFSL(SL,"entry.emphase",True)] # '$entry_value_classes[$entry.emphase]' on line 84, col 17
 
266
                    if _v is not None: write(_filter(_v, rawExpr='$entry_value_classes[$entry.emphase]')) # from line 84, col 17.
 
267
                    write('''">''')
 
268
                    _v = VFFSL(SL,"entry.value",True) # '$entry.value' on line 84, col 55
 
269
                    if _v is not None: write(_filter(_v, rawExpr='$entry.value')) # from line 84, col 55.
 
270
                    write('''</td>
267
271
\t\t\t\t</tr>
268
272
 
269
273
''')
270
274
                    cnt += 1
271
 
                write(u'''\t\t</table>
 
275
                write('''\t\t</table>
272
276
''')
273
 
            write(u'''
 
277
            write('''
274
278
''')
275
279
            self._CHEETAH__globalSetVars["section_cnt"] += 1
276
 
            write(u'''
 
280
            write('''
277
281
''')
278
282
            if VFFSL(SL,"section.sections",True): # generated from line 94, col 3
279
 
                write(u'''\t\t    ''')
280
 
                _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"section.sections",True)) # u'$display_node($section.sections)' on line 95, col 7
281
 
                if _v is not None: write(_filter(_v, rawExpr=u'$display_node($section.sections)')) # from line 95, col 7.
282
 
                write(u'''
 
283
                write('''\t\t    ''')
 
284
                _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"section.sections",True)) # '$display_node($section.sections)' on line 95, col 7
 
285
                if _v is not None: write(_filter(_v, rawExpr='$display_node($section.sections)')) # from line 95, col 7.
 
286
                write('''
283
287
''')
284
 
            write(u'''
 
288
            write('''
285
289
\t\t</div>
286
290
 
287
291
\t</fieldset>
315
319
        self._CHEETAH__globalSetVars["section_cnt"] = 0
316
320
        self._CHEETAH__globalSetVars["row_classes"] = ("table_row_even", "table_row_odd")
317
321
        self._CHEETAH__globalSetVars["entry_value_classes"] = ("section_alert_entry_value_normal", "section_alert_entry_value_emphasis")
318
 
        write(u'''
 
322
        write('''
319
323
 
320
324
 
321
325
 
322
326
<div id="fieldset_page">
323
327
''')
324
 
        _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"sections",True)) # u'$display_node($sections)' on line 105, col 1
325
 
        if _v is not None: write(_filter(_v, rawExpr=u'$display_node($sections)')) # from line 105, col 1.
326
 
        write(u'''
 
328
        _v = VFFSL(SL,"display_node",False)(VFFSL(SL,"sections",True)) # '$display_node($sections)' on line 105, col 1
 
329
        if _v is not None: write(_filter(_v, rawExpr='$display_node($sections)')) # from line 105, col 1.
 
330
        write('''
327
331
</div>
328
332
 
329
333
''')
353
357
        ########################################
354
358
        ## START - generated method body
355
359
        
356
 
        write(u'''
 
360
        write('''
357
361
 
358
362
''')
359
363
        self.main_content(trans=trans)