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

« back to all changes in this revision

Viewing changes to prewikka/templates/MessageSummary.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__ = 1244966470.0736561
38
 
__CHEETAH_genTimestamp__ = 'Sun Jun 14 10:01:10 2009'
 
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'
39
35
__CHEETAH_src__ = 'prewikka/templates/MessageSummary.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(MessageSummary, 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('''<script type="text/javascript">
 
84
        write(u'''<script type="text/javascript">
89
85
<!--
90
86
$(document).ready(function() {
91
87
 
130
126
        ########################################
131
127
        ## START - generated method body
132
128
        
133
 
        write('''
 
129
        write(u'''
134
130
''')
135
131
        table_cnt = 0
136
132
        for table in VFFSL(SL,"section.tables",True): # generated from line 32, col 3
137
 
            write('''\t\t
 
133
            write(u'''\t\t
138
134
''')
139
135
            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
140
 
                write('''\t\t  <br/>
 
136
                write(u'''\t\t  <br/>
141
137
''')
142
 
            write('''
 
138
            write(u'''
143
139
''')
144
140
            if VFFSL(SL,"table.odd_even",True): # generated from line 38, col 17
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('''">
 
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'''">
155
151
''')
156
152
            else: # generated from line 40, col 3
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('''">
 
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'''">
164
160
''')
165
 
            write('''
 
161
            write(u'''
166
162
''')
167
163
            table_cnt += 1
168
164
            row_class = ""
169
165
            for row in VFFSL(SL,"table.rows",True): # generated from line 46, col 4
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="">
 
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="">
174
170
''')
175
171
                for col in row: # generated from line 48, col 6
176
172
                    if VFFSL(SL,"col.header",True): # generated from line 49, col 7
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>
 
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>
181
177
''')
182
178
                        row_class = "table_row_even"
183
179
                    elif VFFSL(SL,"col.tables",True): # generated from line 52, col 7
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>
 
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>
188
184
''')
189
185
                        row_class = ""
190
186
                    else: # generated from line 55, col 21
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>
 
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>
202
198
''')
203
199
        
204
200
        ########################################
227
223
        ## START - generated method body
228
224
        
229
225
        for section in VFFSL(SL,"sections",True): # generated from line 67, col 1
230
 
            write('''        <fieldset class="fieldset_heading">
 
226
            write(u'''        <fieldset class="fieldset_heading">
231
227
\t\t<legend><a href="#">''')
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>
 
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>
235
231
\t\t<div style="display: ''')
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%;">
 
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%;">
239
235
\t\t''')
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('''
 
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'''
243
239
 
244
240
''')
245
241
            if VFFSL(SL,"section.entries",True): # generated from line 73, col 3
246
 
                write('''\t\t<table class="section_alert_entries">
 
242
                write(u'''\t\t<table class="section_alert_entries">
247
243
\t\t\t
248
244
''')
249
245
                cnt = 0
250
246
                for entry in VFFSL(SL,"section.entries",True): # generated from line 77, col 4
251
 
                    write('''
 
247
                    write(u'''
252
248
                             
253
249
\t\t\t\t<tr class="section_alert_entry ''')
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('''">
 
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'''">
257
253
''')
258
254
                    if VFFSL(SL,"entry.name",True): # generated from line 81, col 19
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>
 
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>
263
259
''')
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>
 
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>
271
267
\t\t\t\t</tr>
272
268
 
273
269
''')
274
270
                    cnt += 1
275
 
                write('''\t\t</table>
 
271
                write(u'''\t\t</table>
276
272
''')
277
 
            write('''
 
273
            write(u'''
278
274
''')
279
275
            self._CHEETAH__globalSetVars["section_cnt"] += 1
280
 
            write('''
 
276
            write(u'''
281
277
''')
282
278
            if VFFSL(SL,"section.sections",True): # generated from line 94, col 3
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('''
 
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'''
287
283
''')
288
 
            write('''
 
284
            write(u'''
289
285
\t\t</div>
290
286
 
291
287
\t</fieldset>
319
315
        self._CHEETAH__globalSetVars["section_cnt"] = 0
320
316
        self._CHEETAH__globalSetVars["row_classes"] = ("table_row_even", "table_row_odd")
321
317
        self._CHEETAH__globalSetVars["entry_value_classes"] = ("section_alert_entry_value_normal", "section_alert_entry_value_emphasis")
322
 
        write('''
 
318
        write(u'''
323
319
 
324
320
 
325
321
 
326
322
<div id="fieldset_page">
327
323
''')
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('''
 
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'''
331
327
</div>
332
328
 
333
329
''')
357
353
        ########################################
358
354
        ## START - generated method body
359
355
        
360
 
        write('''
 
356
        write(u'''
361
357
 
362
358
''')
363
359
        self.main_content(trans=trans)