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

« back to all changes in this revision

Viewing changes to prewikka/templates/PropertiesChangeForm.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__ = 1244966469.971993
38
 
__CHEETAH_genTimestamp__ = 'Sun Jun 14 10:01:09 2009'
 
31
__CHEETAH_version__ = '2.2.1'
 
32
__CHEETAH_versionTuple__ = (2, 2, 1, 'final', 0)
 
33
__CHEETAH_genTime__ = 1244715456.907383
 
34
__CHEETAH_genTimestamp__ = 'Thu Jun 11 12:17:36 2009'
39
35
__CHEETAH_src__ = 'prewikka/templates/PropertiesChangeForm.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(PropertiesChangeForm, 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('''<form action="?" method="post">
 
84
        write(u'''<form action="?" method="post">
89
85
''')
90
86
        for name, value in VFFSL(SL,"hiddens",True): # generated from line 5, col 1
91
 
            write('''\t<input type="hidden" name="''')
92
 
            _v = VFFSL(SL,"name",True) # '$name' on line 6, col 29
93
 
            if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 6, col 29.
94
 
            write('''" value="''')
95
 
            _v = VFFSL(SL,"value",True) # '$value' on line 6, col 43
96
 
            if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 6, col 43.
97
 
            write('''"/>
 
87
            write(u'''\t<input type="hidden" name="''')
 
88
            _v = VFFSL(SL,"name",True) # u'$name' on line 6, col 29
 
89
            if _v is not None: write(_filter(_v, rawExpr=u'$name')) # from line 6, col 29.
 
90
            write(u'''" value="''')
 
91
            _v = VFFSL(SL,"value",True) # u'$value' on line 6, col 43
 
92
            if _v is not None: write(_filter(_v, rawExpr=u'$value')) # from line 6, col 43.
 
93
            write(u'''"/>
98
94
''')
99
 
        write('''        <table class="properties_change_table">
 
95
        write(u'''        <table class="properties_change_table">
100
96
''')
101
97
        row_classes = ("table_row_even", "table_row_odd")
102
98
        cnt = 0
103
99
        for property in VFFSL(SL,"properties",True): # generated from line 11, col 2
104
 
            write('''\t\t<tr class="''')
105
 
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 12, col 14
106
 
            if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 12, col 14.
107
 
            write('''">
 
100
            write(u'''\t\t<tr class="''')
 
101
            _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 12, col 14
 
102
            if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 12, col 14.
 
103
            write(u'''">
108
104
\t\t\t<td>''')
109
 
            _v = VFFSL(SL,"property.name",True) # '$property.name' on line 13, col 8
110
 
            if _v is not None: write(_filter(_v, rawExpr='$property.name')) # from line 13, col 8.
111
 
            write('''</td>
 
105
            _v = VFFSL(SL,"property.name",True) # u'$property.name' on line 13, col 8
 
106
            if _v is not None: write(_filter(_v, rawExpr=u'$property.name')) # from line 13, col 8.
 
107
            write(u'''</td>
112
108
''')
113
109
            if VFFSL(SL,"property.value",True): # generated from line 14, col 4
114
110
                if VFFSL(SL,"property.type",True) == 'checkbox': # generated from line 15, col 5
117
113
                    value = "value=" + VFFSL(SL,"property.value",True)
118
114
            else: # generated from line 20, col 4
119
115
                value = ""
120
 
            write('''\t\t\t<td><input type="''')
121
 
            _v = VFFSL(SL,"property.type",True) # '$property.type' on line 23, col 21
122
 
            if _v is not None: write(_filter(_v, rawExpr='$property.type')) # from line 23, col 21.
123
 
            write('''" name="''')
124
 
            _v = VFFSL(SL,"property.parameter",True) # '$property.parameter' on line 23, col 43
125
 
            if _v is not None: write(_filter(_v, rawExpr='$property.parameter')) # from line 23, col 43.
126
 
            write('''" ''')
127
 
            _v = VFFSL(SL,"value",True) # '$value' on line 23, col 64
128
 
            if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 23, col 64.
129
 
            write('''/></td>
 
116
            write(u'''\t\t\t<td><input type="''')
 
117
            _v = VFFSL(SL,"property.type",True) # u'$property.type' on line 23, col 21
 
118
            if _v is not None: write(_filter(_v, rawExpr=u'$property.type')) # from line 23, col 21.
 
119
            write(u'''" name="''')
 
120
            _v = VFFSL(SL,"property.parameter",True) # u'$property.parameter' on line 23, col 43
 
121
            if _v is not None: write(_filter(_v, rawExpr=u'$property.parameter')) # from line 23, col 43.
 
122
            write(u'''" ''')
 
123
            _v = VFFSL(SL,"value",True) # u'$value' on line 23, col 64
 
124
            if _v is not None: write(_filter(_v, rawExpr=u'$value')) # from line 23, col 64.
 
125
            write(u'''/></td>
130
126
\t\t</tr>
131
127
''')
132
128
            cnt += 1
133
 
        write('''\t</table>
 
129
        write(u'''\t</table>
134
130
\t<br/>
135
131
\t<input type="submit" value="''')
136
 
        _v = VFFSL(SL,"submit",True) # '$submit' on line 29, col 30
137
 
        if _v is not None: write(_filter(_v, rawExpr='$submit')) # from line 29, col 30.
138
 
        write('''"/>
 
132
        _v = VFFSL(SL,"submit",True) # u'$submit' on line 29, col 30
 
133
        if _v is not None: write(_filter(_v, rawExpr=u'$submit')) # from line 29, col 30.
 
134
        write(u'''"/>
139
135
</form>
140
136
''')
141
137
        
164
160
        ########################################
165
161
        ## START - generated method body
166
162
        
167
 
        write('''
 
163
        write(u'''
168
164
''')
169
165
        self.main_content(trans=trans)
170
166