6 ##################################################
12 import builtins as builtin
14 import __builtin__ as builtin
15 from os.path import getmtime, exists
18 from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
19 from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
20 from Cheetah.Template import Template
21 from Cheetah.DummyTransaction import *
22 from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
23 from Cheetah.CacheRegion import CacheRegion
24 import Cheetah.Filters as Filters
25 import Cheetah.ErrorCatchers as ErrorCatchers
26 from Redirect import Redirect
28 ##################################################
30 VFFSL=valueFromFrameOrSearchList
31 VFSL=valueFromSearchList
34 __CHEETAH_version__ = '2.4.4'
35 __CHEETAH_versionTuple__ = (2, 4, 4, 'development', 1)
36 __CHEETAH_genTime__ = 1400552323.307355
37 __CHEETAH_genTimestamp__ = 'Tue May 20 06:18:43 2014'
38 __CHEETAH_src__ = 'redirect.tmpl'
39 __CHEETAH_srcLastModified__ = 'Thu Feb 3 17:59:20 2005'
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 redirect(Redirect):
53 ##################################################
54 ## CHEETAH GENERATED METHODS
57 def __init__(self, *args, **KWs):
59 super(redirect, self).__init__(*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
86 write(u'''<H1>Moved</H1>
88 <p>The document has been moved <a href="''')
89 _v = VFFSL(SL,"url",True) # u'$url' on line 5, col 41
90 if _v is not None: write(_filter(_v, rawExpr=u'$url')) # from line 5, col 41.
91 write(u'''">here</a>.</p>
94 ########################################
95 ## END - generated method body
97 return _dummyTrans and trans.response().getvalue() or ""
99 ##################################################
100 ## CHEETAH GENERATED ATTRIBUTES
103 _CHEETAH__instanceInitialized = False
105 _CHEETAH_version = __CHEETAH_version__
107 _CHEETAH_versionTuple = __CHEETAH_versionTuple__
109 _CHEETAH_genTime = __CHEETAH_genTime__
111 _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
113 _CHEETAH_src = __CHEETAH_src__
115 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
117 _mainCheetahMethod_for_redirect= u'respond'
119 ## END CLASS DEFINITION
121 if not hasattr(redirect, '_initCheetahAttributes'):
122 templateAPIClass = getattr(redirect, '_CHEETAH_templateClass', Template)
123 templateAPIClass._addCheetahPlumbingCodeToClass(redirect)
126 # CHEETAH was developed by Tavis Rudd and Mike Orr
127 # with code, advice and input from many other volunteers.
128 # For more information visit http://www.CheetahTemplate.org/
130 ##################################################
131 ## if run from command line:
132 if __name__ == '__main__':
133 from Cheetah.TemplateCmdLineIface import CmdLineIface
134 CmdLineIface(templateObj=redirect()).run()