2 # -*- coding: utf-8 -*-
7 ##################################################
13 import builtins as builtin
15 import __builtin__ as builtin
16 from os.path import getmtime, exists
19 from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
20 from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
21 from Cheetah.Template import Template
22 from Cheetah.DummyTransaction import *
23 from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
24 from Cheetah.CacheRegion import CacheRegion
25 import Cheetah.Filters as Filters
26 import Cheetah.ErrorCatchers as ErrorCatchers
27 from Cheetah.compat import unicode
28 from bottle import html_escape
30 ##################################################
32 VFFSL=valueFromFrameOrSearchList
33 VFSL=valueFromSearchList
36 __CHEETAH_version__ = '3.3.1'
37 __CHEETAH_versionTuple__ = (3, 3, 1, 'final', 0)
38 __CHEETAH_genTime__ = 1704845598.452284
39 __CHEETAH_genTimestamp__ = 'Wed Jan 10 03:13:18 2024'
40 __CHEETAH_src__ = 'search_authors_form.tmpl'
41 __CHEETAH_srcLastModified__ = 'Wed Jan 10 03:02:59 2024'
42 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
44 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
46 'This template was compiled with Cheetah version'
47 ' %s. Templates compiled before version %s must be recompiled.'%(
48 __CHEETAH_version__, RequiredCheetahVersion))
50 ##################################################
53 class search_authors_form(Template):
55 ##################################################
56 ## CHEETAH GENERATED METHODS
59 def __init__(self, *args, **KWs):
61 super(search_authors_form, self).__init__(*args, **KWs)
62 if not self._CHEETAH__instanceInitialized:
64 allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
65 for k,v in KWs.items():
66 if k in allowedKWs: cheetahKWArgs[k] = v
67 self._initCheetahInstance(**cheetahKWArgs)
70 def search_type_checked(self, value, **KWS):
74 ## CHEETAH: generated from #def $search_type_checked($value) at line 3, col 1.
75 trans = KWS.get("trans")
76 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
77 trans = self.transaction # is None unless self.awake() was called
79 trans = DummyTransaction()
81 else: _dummyTrans = False
82 write = trans.response().write
83 SL = self._CHEETAH__searchList
84 _filter = self._CHEETAH__currentFilter
86 ########################################
87 ## START - generated method body
89 if VFFSL(SL,"getVar",False)('search_type', '') == VFFSL(SL,"value",True): # generated from line 4, col 1
92 ########################################
93 ## END - generated method body
95 return _dummyTrans and trans.response().getvalue() or ""
98 def case_sensitive_checked(self, **KWS):
102 ## CHEETAH: generated from #def $case_sensitive_checked at line 8, col 1.
103 trans = KWS.get("trans")
104 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
105 trans = self.transaction # is None unless self.awake() was called
107 trans = DummyTransaction()
109 else: _dummyTrans = False
110 write = trans.response().write
111 SL = self._CHEETAH__searchList
112 _filter = self._CHEETAH__currentFilter
114 ########################################
115 ## START - generated method body
117 if VFFSL(SL,"getVar",False)('case_sensitive', None): # generated from line 9, col 1
118 write(u'''checked''')
120 ########################################
121 ## END - generated method body
123 return _dummyTrans and trans.response().getvalue() or ""
126 def respond(self, trans=None):
130 ## CHEETAH: main method generated for this template
131 if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
132 trans = self.transaction # is None unless self.awake() was called
134 trans = DummyTransaction()
136 else: _dummyTrans = False
137 write = trans.response().write
138 SL = self._CHEETAH__searchList
139 _filter = self._CHEETAH__currentFilter
141 ########################################
142 ## START - generated method body
144 write(u'''<form action="/search_authors/" method="POST">
145 <div style="width: 100%">
146 <input name="search_authors" value="''')
147 _v = VFFSL(SL,"html_escape",False)(VFFSL(SL,"getVar",False)('search_authors',
149 if _v is not None: write(_filter(_v, rawExpr=u"$html_escape($getVar('search_authors',\n ''))")) # from line 15, col 39.
150 write(u'''" type="text" style="width: 100%">
152 <input name="search_type" value="start" ''')
153 _v = VFFSL(SL,"search_type_checked",False)('start') # u"$search_type_checked('start')" on line 18, col 43
154 if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('start')")) # from line 18, col 43.
155 write(u''' type="radio">
156 \u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435
157 <input name="search_type" value="substring" ''')
158 _v = VFFSL(SL,"search_type_checked",False)('substring') # u"$search_type_checked('substring')" on line 20, col 47
159 if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('substring')")) # from line 20, col 47.
160 write(u''' type="radio">
161 \u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430
162 <input name="search_type" value="full" ''')
163 _v = VFFSL(SL,"search_type_checked",False)('full') # u"$search_type_checked('full')" on line 22, col 42
164 if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('full')")) # from line 22, col 42.
165 write(u''' type="radio">
166 \u0422\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435
168 <input name="case_sensitive" type="checkbox" ''')
169 _v = VFFSL(SL,"case_sensitive_checked",True) # u'$case_sensitive_checked' on line 25, col 48
170 if _v is not None: write(_filter(_v, rawExpr=u'$case_sensitive_checked')) # from line 25, col 48.
172 \u0420\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0435/\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435
174 <div style="width: 100%; text-align: center">
175 <input name="submit" type="submit" value="\u0418\u0441\u043a\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u043e\u0432">
180 ########################################
181 ## END - generated method body
183 return _dummyTrans and trans.response().getvalue() or ""
185 ##################################################
186 ## CHEETAH GENERATED ATTRIBUTES
189 _CHEETAH__instanceInitialized = False
191 _CHEETAH_version = __CHEETAH_version__
193 _CHEETAH_versionTuple = __CHEETAH_versionTuple__
195 _CHEETAH_genTime = __CHEETAH_genTime__
197 _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
199 _CHEETAH_src = __CHEETAH_src__
201 _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
203 _mainCheetahMethod_for_search_authors_form = 'respond'
205 ## END CLASS DEFINITION
207 if not hasattr(search_authors_form, '_initCheetahAttributes'):
208 templateAPIClass = getattr(search_authors_form,
209 '_CHEETAH_templateClass',
211 templateAPIClass._addCheetahPlumbingCodeToClass(search_authors_form)
214 # CHEETAH was developed by Tavis Rudd and Mike Orr
215 # with code, advice and input from many other volunteers.
216 # For more information visit https://cheetahtemplate.org/
218 ##################################################
219 ## if run from command line:
220 if __name__ == '__main__':
221 from Cheetah.TemplateCmdLineIface import CmdLineIface
222 CmdLineIface(templateObj=search_authors_form()).run()