]> git.phdru.name Git - m_librarian.git/blob - m_librarian/web/views/index.py
Feat(web): Search authors
[m_librarian.git] / m_librarian / web / views / index.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4
5
6
7 ##################################################
8 ## DEPENDENCIES
9 import sys
10 import os
11 import os.path
12 try:
13     import builtins as builtin
14 except ImportError:
15     import __builtin__ as builtin
16 from os.path import getmtime, exists
17 import time
18 import types
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 views.layout import layout
29 from views.search_authors_form import search_authors_form
30
31 ##################################################
32 ## MODULE CONSTANTS
33 VFFSL=valueFromFrameOrSearchList
34 VFSL=valueFromSearchList
35 VFN=valueForName
36 currentTime=time.time
37 __CHEETAH_version__ = '3.1.0'
38 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
39 __CHEETAH_genTime__ = 1522958547.022135
40 __CHEETAH_genTimestamp__ = 'Thu Apr  5 23:02:27 2018'
41 __CHEETAH_src__ = 'index.tmpl'
42 __CHEETAH_srcLastModified__ = 'Thu Apr  5 23:02:23 2018'
43 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
44
45 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
46     raise AssertionError(
47       'This template was compiled with Cheetah version'
48       ' %s. Templates compiled before version %s must be recompiled.'%(
49          __CHEETAH_version__, RequiredCheetahVersion))
50
51 ##################################################
52 ## CLASSES
53
54 class index(layout):
55
56     ##################################################
57     ## CHEETAH GENERATED METHODS
58
59
60     def __init__(self, *args, **KWs):
61
62         super(index, self).__init__(*args, **KWs)
63         if not self._CHEETAH__instanceInitialized:
64             cheetahKWArgs = {}
65             allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
66             for k,v in KWs.items():
67                 if k in allowedKWs: cheetahKWArgs[k] = v
68             self._initCheetahInstance(**cheetahKWArgs)
69         
70
71     def body(self, **KWS):
72
73
74
75         ## CHEETAH: generated from #def body at line 4, col 1.
76         trans = KWS.get("trans")
77         if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
78             trans = self.transaction # is None unless self.awake() was called
79         if not trans:
80             trans = DummyTransaction()
81             _dummyTrans = True
82         else: _dummyTrans = False
83         write = trans.response().write
84         SL = self._CHEETAH__searchList
85         _filter = self._CHEETAH__currentFilter
86         
87         ########################################
88         ## START - generated method body
89         
90         write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
91
92 ''')
93         _v = VFFSL(SL,"search_authors_form",False)() # u'$search_authors_form()' on line 8, col 1
94         if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form()')) # from line 8, col 1.
95         write(u'''
96 ''')
97         
98         ########################################
99         ## END - generated method body
100         
101         return _dummyTrans and trans.response().getvalue() or ""
102         
103
104     def writeBody(self, **KWS):
105
106
107
108         ## CHEETAH: main method generated for this template
109         trans = KWS.get("trans")
110         if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
111             trans = self.transaction # is None unless self.awake() was called
112         if not trans:
113             trans = DummyTransaction()
114             _dummyTrans = True
115         else: _dummyTrans = False
116         write = trans.response().write
117         SL = self._CHEETAH__searchList
118         _filter = self._CHEETAH__currentFilter
119         
120         ########################################
121         ## START - generated method body
122         
123         
124         ########################################
125         ## END - generated method body
126         
127         return _dummyTrans and trans.response().getvalue() or ""
128         
129     ##################################################
130     ## CHEETAH GENERATED ATTRIBUTES
131
132
133     _CHEETAH__instanceInitialized = False
134
135     _CHEETAH_version = __CHEETAH_version__
136
137     _CHEETAH_versionTuple = __CHEETAH_versionTuple__
138
139     _CHEETAH_genTime = __CHEETAH_genTime__
140
141     _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
142
143     _CHEETAH_src = __CHEETAH_src__
144
145     _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
146
147     title = 'Поиск'
148
149     _mainCheetahMethod_for_index = 'writeBody'
150
151 ## END CLASS DEFINITION
152
153 if not hasattr(index, '_initCheetahAttributes'):
154     templateAPIClass = getattr(index,
155                                '_CHEETAH_templateClass',
156                                Template)
157     templateAPIClass._addCheetahPlumbingCodeToClass(index)
158
159
160 # CHEETAH was developed by Tavis Rudd and Mike Orr
161 # with code, advice and input from many other volunteers.
162 # For more information visit http://cheetahtemplate.org/
163
164 ##################################################
165 ## if run from command line:
166 if __name__ == '__main__':
167     from Cheetah.TemplateCmdLineIface import CmdLineIface
168     CmdLineIface(templateObj=index()).run()
169
170