6
##################################################
11
from os.path import getmtime, exists
15
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
16
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
17
from Cheetah.Template import Template
18
from Cheetah.DummyTransaction import DummyTransaction
19
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
20
from Cheetah.CacheRegion import CacheRegion
21
import Cheetah.Filters as Filters
22
import Cheetah.ErrorCatchers as ErrorCatchers
23
from prewikka.templates.ClassicLayout import ClassicLayout
25
##################################################
30
True, False = (1==1), (1==0)
31
VFFSL=valueFromFrameOrSearchList
32
VFSL=valueFromSearchList
35
__CHEETAH_version__ = '2.0rc7'
36
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 7)
37
__CHEETAH_genTime__ = 1166283667.9657021
38
__CHEETAH_genTimestamp__ = 'Sat Dec 16 16:41:07 2006'
39
__CHEETAH_src__ = 'prewikka/templates/PropertiesChangeForm.tmpl'
40
__CHEETAH_srcLastModified__ = 'Fri Dec 15 10:49:19 2006'
41
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
43
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
45
'This template was compiled with Cheetah version'
46
' %s. Templates compiled before version %s must be recompiled.'%(
47
__CHEETAH_version__, RequiredCheetahVersion))
49
##################################################
52
class PropertiesChangeForm(ClassicLayout):
54
##################################################
55
## CHEETAH GENERATED METHODS
58
def __init__(self, *args, **KWs):
60
ClassicLayout.__init__(self, *args, **KWs)
61
if not self._CHEETAH__instanceInitialized:
63
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
64
for k,v in KWs.items():
65
if k in allowedKWs: cheetahKWArgs[k] = v
66
self._initCheetahInstance(**cheetahKWArgs)
69
def main_content(self, **KWS):
73
## CHEETAH: generated from #block main_content at line 3, col 1.
74
trans = KWS.get("trans")
75
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
76
trans = self.transaction # is None unless self.awake() was called
78
trans = DummyTransaction()
80
else: _dummyTrans = False
81
write = trans.response().write
82
SL = self._CHEETAH__searchList
83
_filter = self._CHEETAH__currentFilter
85
########################################
86
## START - generated method body
88
write('<form action="?" method="post">\n')
89
for name, value in VFFSL(SL,"hiddens",True): # generated from line 5, col 1
90
write('\t<input type="hidden" name="')
91
_v = VFFSL(SL,"name",True) # '$name' on line 6, col 29
92
if _v is not None: write(_filter(_v, rawExpr='$name')) # from line 6, col 29.
94
_v = VFFSL(SL,"value",True) # '$value' on line 6, col 43
95
if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 6, col 43.
97
write(' <table class="properties_change_table">\n')
98
row_classes = ("table_row_even", "table_row_odd")
100
for property in VFFSL(SL,"properties",True): # generated from line 11, col 2
101
write('\t\t<tr class="')
102
_v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # '$row_classes[$cnt%2]' on line 12, col 14
103
if _v is not None: write(_filter(_v, rawExpr='$row_classes[$cnt%2]')) # from line 12, col 14.
104
write('">\n\t\t\t<td>')
105
_v = VFFSL(SL,"property.name",True) # '$property.name' on line 13, col 8
106
if _v is not None: write(_filter(_v, rawExpr='$property.name')) # from line 13, col 8.
108
if VFFSL(SL,"property.value",True): # generated from line 14, col 4
109
if VFFSL(SL,"property.type",True) == 'checkbox': # generated from line 15, col 5
111
else: # generated from line 17, col 5
112
value = "value=" + VFFSL(SL,"property.value",True)
113
else: # generated from line 20, col 4
115
write('\t\t\t<td><input type="')
116
_v = VFFSL(SL,"property.type",True) # '$property.type' on line 23, col 21
117
if _v is not None: write(_filter(_v, rawExpr='$property.type')) # from line 23, col 21.
119
_v = VFFSL(SL,"property.parameter",True) # '$property.parameter' on line 23, col 43
120
if _v is not None: write(_filter(_v, rawExpr='$property.parameter')) # from line 23, col 43.
122
_v = VFFSL(SL,"value",True) # '$value' on line 23, col 64
123
if _v is not None: write(_filter(_v, rawExpr='$value')) # from line 23, col 64.
124
write('/></td>\n\t\t</tr>\n')
126
write('\t</table>\n\t<br/>\n\t<input type="submit" value="')
127
_v = VFFSL(SL,"submit",True) # '$submit' on line 29, col 30
128
if _v is not None: write(_filter(_v, rawExpr='$submit')) # from line 29, col 30.
129
write('"/>\n</form>\n')
131
########################################
132
## END - generated method body
134
return _dummyTrans and trans.response().getvalue() or ""
137
def writeBody(self, **KWS):
141
## CHEETAH: main method generated for this template
142
trans = KWS.get("trans")
143
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
144
trans = self.transaction # is None unless self.awake() was called
146
trans = DummyTransaction()
148
else: _dummyTrans = False
149
write = trans.response().write
150
SL = self._CHEETAH__searchList
151
_filter = self._CHEETAH__currentFilter
153
########################################
154
## START - generated method body
157
self.main_content(trans=trans)
159
########################################
160
## END - generated method body
162
return _dummyTrans and trans.response().getvalue() or ""
164
##################################################
165
## CHEETAH GENERATED ATTRIBUTES
168
_CHEETAH__instanceInitialized = False
170
_CHEETAH_version = __CHEETAH_version__
172
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
174
_CHEETAH_genTime = __CHEETAH_genTime__
176
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
178
_CHEETAH_src = __CHEETAH_src__
180
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
182
_mainCheetahMethod_for_PropertiesChangeForm= 'writeBody'
184
## END CLASS DEFINITION
186
if not hasattr(PropertiesChangeForm, '_initCheetahAttributes'):
187
templateAPIClass = getattr(PropertiesChangeForm, '_CHEETAH_templateClass', Template)
188
templateAPIClass._addCheetahPlumbingCodeToClass(PropertiesChangeForm)
191
# CHEETAH was developed by Tavis Rudd and Mike Orr
192
# with code, advice and input from many other volunteers.
193
# For more information visit http://www.CheetahTemplate.org/
195
##################################################
196
## if run from command line:
197
if __name__ == '__main__':
198
from Cheetah.TemplateCmdLineIface import CmdLineIface
199
CmdLineIface(templateObj=PropertiesChangeForm()).run()