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
24 ##################################################
29 True, False = (1==1), (1==0)
30 VFFSL=valueFromFrameOrSearchList
31 VFSL=valueFromSearchList
34 __CHEETAH_version__ = '2.0rc8'
35 __CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8)
36 __CHEETAH_genTime__ = 1191715796.9141691
37 __CHEETAH_genTimestamp__ = 'Sat Oct 6 20:09:56 2007'
38 __CHEETAH_src__ = 'mainpage.tmpl'
39 __CHEETAH_srcLastModified__ = 'Sat Oct 6 20:09:44 2007'
40 __CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
42 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
44 'This template was compiled with Cheetah version'
45 ' %s. Templates compiled before version %s must be recompiled.'%(
46 __CHEETAH_version__, RequiredCheetahVersion))
48 ##################################################
51 class mainpage(Template):
53 ##################################################
54 ## CHEETAH GENERATED METHODS
57 def __init__(self, *args, **KWs):
59 Template.__init__(self, *args, **KWs)
60 if not self._CHEETAH__instanceInitialized:
62 allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
63 for k,v in KWs.items():
64 if k in allowedKWs: cheetahKWArgs[k] = v
65 self._initCheetahInstance(**cheetahKWArgs)
68 def respond(self, trans=None):
72 ## CHEETAH: main method generated for this template
73 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
74 trans = self.transaction # is None unless self.awake() was called
76 trans = DummyTransaction()
78 else: _dummyTrans = False
79 write = trans.response().write
80 SL = self._CHEETAH__searchList
81 _filter = self._CHEETAH__currentFilter
83 ########################################
84 ## START - generated method body
87 <head><title>Status for order #''')
88 _v = VFFSL(SL,"order.id",True) # '$order.id' on line 2, col 32
89 if _v is not None: write(_filter(_v, rawExpr='$order.id')) # from line 2, col 32.
90 write('''</title></head>
92 <p>[You are logged in as ''')
93 _v = VFN(VFFSL(SL,"user",True),"getFullName",False)() # '$user.getFullName()' on line 4, col 26
94 if _v is not None: write(_filter(_v, rawExpr='$user.getFullName()')) # from line 4, col 26.
98 if (VFN(VFFSL(SL,"order",True),"hasShipped",False)()): # generated from line 6, col 1
99 write(''' Your order has shipped. Your tracking number is ''')
100 _v = VFFSL(SL,"order.trackingNumber",True) # '$order.trackingNumber' on line 7, col 50
101 if _v is not None: write(_filter(_v, rawExpr='$order.trackingNumber')) # from line 7, col 50.
104 else: # generated from line 8, col 1
105 write(''' Your order has not yet shipped.
109 _v = VFFSL(SL,"order.id",True) # '$order.id' on line 12, col 11
110 if _v is not None: write(_filter(_v, rawExpr='$order.id')) # from line 12, col 11.
111 write(''' contains the following items:</p>
114 for purchased, quantity in VFN(VFFSL(SL,"order.purchased",True),"items",False)(): # generated from line 14, col 1
116 _v = VFFSL(SL,"purchased.name",True) # '$purchased.name' on line 15, col 6
117 if _v is not None: write(_filter(_v, rawExpr='$purchased.name')) # from line 15, col 6.
119 _v = VFFSL(SL,"quantity",True) # '$quantity' on line 15, col 23
120 if _v is not None: write(_filter(_v, rawExpr='$quantity')) # from line 15, col 23.
122 if (VFFSL(SL,"quantity",True) != 1): # generated from line 16, col 1
129 Served by Online Store v1.0
134 ########################################
135 ## END - generated method body
137 return _dummyTrans and trans.response().getvalue() or ""
139 ##################################################
140 ## CHEETAH GENERATED ATTRIBUTES
143 _CHEETAH__instanceInitialized = False
145 _CHEETAH_version = __CHEETAH_version__
147 _CHEETAH_versionTuple = __CHEETAH_versionTuple__
149 _CHEETAH_genTime = __CHEETAH_genTime__
151 _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
153 _CHEETAH_src = __CHEETAH_src__
155 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
157 _mainCheetahMethod_for_mainpage= 'respond'
159 ## END CLASS DEFINITION
161 if not hasattr(mainpage, '_initCheetahAttributes'):
162 templateAPIClass = getattr(mainpage, '_CHEETAH_templateClass', Template)
163 templateAPIClass._addCheetahPlumbingCodeToClass(mainpage)
166 # CHEETAH was developed by Tavis Rudd and Mike Orr
167 # with code, advice and input from many other volunteers.
168 # For more information visit http://www.CheetahTemplate.org/
170 ##################################################
171 ## if run from command line:
172 if __name__ == '__main__':
173 from Cheetah.TemplateCmdLineIface import CmdLineIface
174 CmdLineIface(templateObj=mainpage()).run()