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

« back to all changes in this revision

Viewing changes to prewikka/templates/PropertiesChangeForm.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.907383
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.4718139
 
38
__CHEETAH_genTimestamp__ = 'Tue Sep  8 11:23:38 2009'
35
39
__CHEETAH_src__ = 'prewikka/templates/PropertiesChangeForm.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(PropertiesChangeForm, 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'''<form action="?" method="post">
 
88
        write('''<form action="?" method="post">
85
89
''')
86
90
        for name, value in VFFSL(SL,"hiddens",True): # generated from line 5, col 1
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'''"/>
 
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('''"/>
94
98
''')
95
 
        write(u'''        <table class="properties_change_table">
 
99
        write('''        <table class="properties_change_table">
96
100
''')
97
101
        row_classes = ("table_row_even", "table_row_odd")
98
102
        cnt = 0
99
103
        for property in VFFSL(SL,"properties",True): # generated from line 11, col 2
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'''">
 
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('''">
104
108
\t\t\t<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>
 
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>
108
112
''')
109
113
            if VFFSL(SL,"property.value",True): # generated from line 14, col 4
110
114
                if VFFSL(SL,"property.type",True) == 'checkbox': # generated from line 15, col 5
113
117
                    value = "value=" + VFFSL(SL,"property.value",True)
114
118
            else: # generated from line 20, col 4
115
119
                value = ""
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>
 
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>
126
130
\t\t</tr>
127
131
''')
128
132
            cnt += 1
129
 
        write(u'''\t</table>
 
133
        write('''\t</table>
130
134
\t<br/>
131
135
\t<input type="submit" value="''')
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'''"/>
 
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('''"/>
135
139
</form>
136
140
''')
137
141
        
160
164
        ########################################
161
165
        ## START - generated method body
162
166
        
163
 
        write(u'''
 
167
        write('''
164
168
''')
165
169
        self.main_content(trans=trans)
166
170