]> git.phdru.name Git - m_librarian.git/blob - m_librarian/web/views/layout.py
Feat(web): Use CheetahTemplate
[m_librarian.git] / m_librarian / web / views / layout.py
1 #!/usr/bin/env python
2
3
4
5
6 ##################################################
7 ## DEPENDENCIES
8 import sys
9 import os
10 import os.path
11 try:
12     import builtins as builtin
13 except ImportError:
14     import __builtin__ as builtin
15 from os.path import getmtime, exists
16 import time
17 import types
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 Cheetah.compat import unicode
27
28 ##################################################
29 ## MODULE CONSTANTS
30 VFFSL=valueFromFrameOrSearchList
31 VFSL=valueFromSearchList
32 VFN=valueForName
33 currentTime=time.time
34 __CHEETAH_version__ = '3.1.0'
35 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
36 __CHEETAH_genTime__ = 1522609587.049776
37 __CHEETAH_genTimestamp__ = 'Sun Apr  1 22:06:27 2018'
38 __CHEETAH_src__ = 'layout.tmpl'
39 __CHEETAH_srcLastModified__ = 'Sun Apr  1 22:06:06 2018'
40 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
41
42 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
43     raise AssertionError(
44       'This template was compiled with Cheetah version'
45       ' %s. Templates compiled before version %s must be recompiled.'%(
46          __CHEETAH_version__, RequiredCheetahVersion))
47
48 ##################################################
49 ## CLASSES
50
51 class layout(Template):
52
53     ##################################################
54     ## CHEETAH GENERATED METHODS
55
56
57     def __init__(self, *args, **KWs):
58
59         super(layout, self).__init__(*args, **KWs)
60         if not self._CHEETAH__instanceInitialized:
61             cheetahKWArgs = {}
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)
66         
67
68     def respond(self, trans=None):
69
70
71
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
75         if not trans:
76             trans = DummyTransaction()
77             _dummyTrans = True
78         else: _dummyTrans = False
79         write = trans.response().write
80         SL = self._CHEETAH__searchList
81         _filter = self._CHEETAH__currentFilter
82         
83         ########################################
84         ## START - generated method body
85         
86         write(u'''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
87    "http://www.w3.org/TR/html4/loose.dtd">
88 <html>
89 <!-- THIS PAGE IS AUTOMATICALLY GENERATED USING CheetahTemplate. DO NOT EDIT. -->
90 <head>
91 <meta HTTP-Equiv="Content-Type" content="text/html">
92 <title>''')
93         _v = VFFSL(SL,"title",True) # u'$title' on line 8, col 8
94         if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 8, col 8.
95         write(u'''</title>
96 <meta name="author" content="Oleg Broytman">
97 <meta name="copyright" content="&copy; 2018 PhiloSoft Design">
98 <link rev="made" href="mailto:phd@phdru.name">
99 <meta name="generator" content="CheetahTemplate">
100 <meta name="MSSmartTagsPreventParsing" content="TRUE"> <!-- MUST DIE -->
101 </head>
102 <body bgcolor="#CCCCCC" text="#000000"
103       link="#0000bb"  vlink="#551a8b" alink="#ff0000">
104 ''')
105         _v = VFFSL(SL,"body",True) # u'$body' on line 17, col 1
106         if _v is not None: write(_filter(_v, rawExpr=u'$body')) # from line 17, col 1.
107         write(u'''
108 </body>
109 </html>
110 ''')
111         
112         ########################################
113         ## END - generated method body
114         
115         return _dummyTrans and trans.response().getvalue() or ""
116         
117     ##################################################
118     ## CHEETAH GENERATED ATTRIBUTES
119
120
121     _CHEETAH__instanceInitialized = False
122
123     _CHEETAH_version = __CHEETAH_version__
124
125     _CHEETAH_versionTuple = __CHEETAH_versionTuple__
126
127     _CHEETAH_genTime = __CHEETAH_genTime__
128
129     _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
130
131     _CHEETAH_src = __CHEETAH_src__
132
133     _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
134
135     title = ''
136
137     _mainCheetahMethod_for_layout = 'respond'
138
139 ## END CLASS DEFINITION
140
141 if not hasattr(layout, '_initCheetahAttributes'):
142     templateAPIClass = getattr(layout,
143                                '_CHEETAH_templateClass',
144                                Template)
145     templateAPIClass._addCheetahPlumbingCodeToClass(layout)
146
147
148 # CHEETAH was developed by Tavis Rudd and Mike Orr
149 # with code, advice and input from many other volunteers.
150 # For more information visit http://cheetahtemplate.org/
151
152 ##################################################
153 ## if run from command line:
154 if __name__ == '__main__':
155     from Cheetah.TemplateCmdLineIface import CmdLineIface
156     CmdLineIface(templateObj=layout()).run()
157
158