/opt/cloudlinux/venv/lib/python3.11/site-packages/mako/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/mako/__pycache__/lookup.cpython-311.pyc (14350B)
§
LU~ñ\½�Jã óˆ — d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlm Z G d„ d¦ « Z
G d„ de
¦ « ZdS ) é N)Ú
exceptions)Úutil)ÚTemplatec ó, — e Zd ZdZd„ Zdd„Zd„ Zd„ ZdS )ÚTemplateCollectiona; Represent a collection of :class:`.Template` objects,
identifiable via URI.
A :class:`.TemplateCollection` is linked to the usage of
all template tags that address other templates, such
as ``<%include>``, ``<%namespace>``, and ``<%inherit>``.
The ``file`` attribute of each of those tags refers
to a string URI that is passed to that :class:`.Template`
object's :class:`.TemplateCollection` for resolution.
:class:`.TemplateCollection` is an abstract class,
with the usual default implementation being :class:`.TemplateLookup`.
c ó^ — | |¦ « dS # t j $ r Y dS w xY w)zÕReturn ``True`` if this :class:`.TemplateLookup` is
capable of returning a :class:`.Template` object for the
given ``uri``.
:param uri: String URI of the template to be resolved.
TF)Úget_templater ÚTemplateLookupException)ÚselfÚuris ú]/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/mako/lookup.pyÚhas_templatezTemplateCollection.has_template# sE € ð Ø×Ò˜cÑ"Ô"Ð"Ø�4øÝÔ1ð ð ð Ø�5�5ð øøøs ‚ ™,«,Nc ó — t ¦ « ‚)aË Return a :class:`.Template` object corresponding to the given
``uri``.
The default implementation raises
:class:`.NotImplementedError`. Implementations should
raise :class:`.TemplateLookupException` if the given ``uri``
cannot be resolved.
:param uri: String URI of the template to be resolved.
:param relativeto: if present, the given ``uri`` is assumed to
be relative to this URI.
)ÚNotImplementedError)r r Ú
relativetos r
r zTemplateCollection.get_template1 s € õ "Ñ#Ô#Ð#ó c ó — |S ©z^Convert the given ``filename`` to a URI relative to
this :class:`.TemplateCollection`.© ©r r Úfilenames r
Úfilename_to_uriz"TemplateCollection.filename_to_uriA s € ð ˆ
r c ó — |S )aÜ Adjust the given ``uri`` based on the calling ``filename``.
When this method is called from the runtime, the
``filename`` parameter is taken directly to the ``filename``
attribute of the calling template. Therefore a custom
:class:`.TemplateCollection` subclass can place any string
identifier desired in the ``filename`` parameter of the
:class:`.Template` objects it constructs and have them come back
here.
r r s r
Ú
adjust_urizTemplateCollection.adjust_uriG s € ð ˆ
r )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r r
r r s_ € € € € € ð
ð
ðð ð ð$ð $ð $ð $ð ð ð ðð ð ð ð r r c ó~ — e Zd ZdZ dd „Zd
„ Zd„ Zd„ Zd
„ Zd„ Z d„ Z
d„ Zd„ ZdS )ÚTemplateLookupaà Represent a collection of templates that locates template source files
from the local filesystem.
The primary argument is the ``directories`` argument, the list of
directories to search:
.. sourcecode:: python
lookup = TemplateLookup(["/path/to/templates"])
some_template = lookup.get_template("/index.html")
The :class:`.TemplateLookup` can also be given :class:`.Template` objects
programatically using :meth:`.put_string` or :meth:`.put_template`:
.. sourcecode:: python
lookup = TemplateLookup()
lookup.put_string("base.html", '''
${self.next()}
''')
lookup.put_string("hello.html", '''
<%include file='base.html'/>
Hello, world !
''')
:param directories: A list of directory names which will be
searched for a particular template URI. The URI is appended
to each directory and the filesystem checked.
:param collection_size: Approximate size of the collection used
to store templates. If left at its default of ``-1``, the size
is unbounded, and a plain Python dictionary is used to
relate URI strings to :class:`.Template` instances.
Otherwise, a least-recently-used cache object is used which
will maintain the size of the collection approximately to
the number given.
:param filesystem_checks: When at its default value of ``True``,
each call to :meth:`.TemplateLookup.get_template()` will
compare the filesystem last modified time to the time in
which an existing :class:`.Template` object was created.
This allows the :class:`.TemplateLookup` to regenerate a
new :class:`.Template` whenever the original source has
been updated. Set this to ``False`` for a very minor
performance increase.
:param modulename_callable: A callable which, when present,
is passed the path of the source file as well as the
requested URI, and then returns the full path of the
generated Python module file. This is used to inject
alternate schemes for Python module location. If left at
its default of ``None``, the built in system of generation
based on ``module_directory`` plus ``uri`` is used.
All other keyword parameters available for
:class:`.Template` are mirrored here. When new
:class:`.Template` objects are created, the keywords
established with this :class:`.TemplateLookup` are passed on
to each new :class:`.Template`.
NTéÿÿÿÿFÚstrictÚbeakerr c óZ — d„ t j |d¦ « D ¦ « | _ || _ || _ || _ || _ | €i } |
r| d|
¦ « |r| d|¦ « |r| d|¦ « i d|“d|“d|“d |“d
|
“d|“d|“d
|“d|“d| “d|“d|“d|“d|“d|“d|“d|“||dœ¥| _ |dk ri | _ i | _
n2t j |¦ « | _ t j |¦ « | _
t j
¦ « | _ d S )Nc ó6 — g | ]}t j |¦ « ‘ŒS r )Ú posixpathÚnormpath)Ú.0Úds r
ú
z+TemplateLookup.__init__..¶ s0 € ð
ð
ð
Ø&'�IÔ˜qÑ!Ô!ð
ð
ð
r r ÚdirÚurlÚtypeÚformat_exceptionsÚ
error_handlerÚinclude_error_handlerÚoutput_encodingÚ
cache_implÚencoding_errorsÚinput_encodingÚmodule_directoryÚ
module_writerÚ
cache_argsÚ
cache_enabledÚdefault_filtersÚbuffer_filtersÚstrict_undefinedÚimportsÚfuture_importsÚenable_loop)ÚpreprocessorÚ lexer_clsr! )r Úto_listÚdirectoriesr5 Úmodulename_callableÚfilesystem_checksÚcollection_sizeÚ
setdefaultÚ
template_argsÚ_collectionÚ
_uri_cacheÚLRUCacheÚ threadingÚLockÚ_mutex)r rB r5 rD rE r. r/ r1 r3 r7 r2 r8 Ú
cache_typeÚ cache_dirÚ cache_urlrC r6 r9 r: r; r<