Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
templating.cpython-313.pyc74 linesDownload Raw Back to __pycache__
1�

2��j���|�SSKJr SSKrSSKJr SSKJr SSKJr SSKJ	r	 SSK3Jr SS	K4Jr SS5K6J
r
 SSK7Jr SSKJr SS
KJr SSKJr \R((aSSKJr SSKJr SSKJr SSjr"SS\5r"SS\5rSSjrSSjrS SjrS!Sjr S"Sjr!S#Sjr"g)$�)�annotationsN)�8BaseLoader)�Environment)�Template)�TemplateNotFound�)�_cv_app)�_cv_request)�current_app)�request)�stream_with_context)�before_render_template)�template_rendered)�Flask)�App)�Scaffoldc��[R"S5n[R"S5n0nUbURUS'UbURUS'U$)zDefault template context processor.  Replaces the ``request`` and ``g``9proxies with their concrete objects for faster access.10N�gr)r	�getr11rr)�appctx�reqctx�rvs   �VD:\code\apps\devtools\python\user_packages\Python313\site-packages\flask/templating.py�_default_template_ctx_processorrsR���[�[��
�F�
�_�_�T�
"�F��B�
���(�(��3��
������9�
��I�c�"�\rSrSrSrSSjrSrg)r�(z�Works like a regular Jinja environment but has some additional12knowledge of how Flask's blueprint works so that it can prepend the13name of the blueprint to referenced templates if necessary.14c�p�SU;aUR5US'[R"U40UD6 Xlg)N�loader)�create_global_jinja_loader�BaseEnvironment�__init__�app)�selfr#�optionss   rr"�Environment.__init__.s5���7�"� #� >� >� @�G�H��� � ��1��1��r�r#N)r#rr%�t.Any�return�None)�__name__�15__module__�__qualname__�__firstlineno__�__doc__r"�__static_attributes__�rrrr(s���16rrc�x�\rSrSrSrSSjrSSjrSSjrSSjrS
Sjr	SSjr17S	rg18)�DispatchingJinjaLoader�5zTA loader that looks for templates in the application and all19the blueprint folders.20c��Xlg�Nr')r$r#s  rr"�DispatchingJinjaLoader.__init__:s���rc��URRS(aURX5$URX5$)N�EXPLAIN_TEMPLATE_LOADING)r#�config�_get_source_explained�_get_source_fast)r$�environment�templates   r�21get_source�!DispatchingJinjaLoader.get_source=s7���8�8�?�?�5�6��-�-�k�D�D��$�$�[�;�;rc��/nSnURU5H/upVURX5nUcUnURXeU45 M1 SSKJn U"URX#5 UbU$[U5e![a SnNNf=f)Nr)�!explain_template_loading_attempts)�
_iter_loadersr?r�append�debughelpersrBr#)	r$r=r>�attempts�trv�srcobjrrrBs	         rr;�,DispatchingJinjaLoader._get_source_explainedDs�����LP��"�0�0��:�N�F�
��&�&�{�=���;��C�
�O�O�V�R�0�1�;�	D�)�$�(�(�H�G��?��J��x�(�(��$�
���
�s�A2�2B�Bc��URU5Hup4URX5s $ [U5e![a M3f=fr6)rCr?r)r$r=r>�_srcobjrs     rr<�'DispatchingJinjaLoader._get_source_fast\sR�� $�1�1�(�;�O�G�
��(�(��?�?� <�22�x�(�(��$�
��
�s�8�23A�Ac#��# �URRnUbURU4v� URR5HnURnUcMX24v� M g7fr6)r#�jinja_loader�iter_blueprints)r$r>r�	blueprints    rrC�$DispatchingJinjaLoader._iter_loadersfsZ������&�&�����(�(�F�"�"����1�1�3�I��+�+�F��!��'�'�4�s�AA$�24A$c�P�[5nURRnUbURUR	55 URR5H<nURnUcMUR	5HnUR
U5 M M> [U5$r6)�setr#rN�update�list_templatesrO�add�list)r$�resultrrPr>s     rrU�%DispatchingJinjaLoader.list_templatesps���������&�&�����M�M�&�/�/�1�2����1�1�3�I��+�+�F��!� &� 5� 5� 7�H��J�J�x�(�!8�4��F�|�rr'N)r#rr)r*)r=r!r>�strr)z3tuple[str, str | None, t.Callable[[], bool] | None])r>rZr)z't.Iterator[tuple[Scaffold, BaseLoader]])r)z	list[str])r+r,r-r.r/r"r?r;r<rCrUr0r1rrr3r35sm����<�*�<�69�<�	<�<�)�*�)�69�)�	<�)�0)�*�)�69�)�	<�)�(�rr3c���URU5 [R"XRXS9 UR	U5n[25R"XRXS9 U$�N��_async_wrapperr>�context)�update_template_contextr�send�ensure_sync�renderr)r#r>r_rs    r�_renderrdsU������(�����O�O�h��26����	!�B�����O�O�h���Irc�z�[R"5nURRU5n[	X#U5$)z�Render a template by name with the given context.27 28:param template_name_or_list: The name of the template to render. If29    a list is given, the first name to exist will be rendered.30:param context: The variables to make available in the template.31)r�_get_current_object�	jinja_env�get_or_select_templaterd��template_name_or_listr_r#r>s    r�render_templaterk�s4���32)�33)�34+�C��}�}�3�3�4I�J�H��3�'�*�*rc�z�[R"5nURRU5n[	X#U5$)z�Render a template from the given source string with the given35context.36 37:param source: The source code of the template to render.38:param context: The variables to make available in the template.39)rrfrg�from_stringrd��sourcer_r#r>s    r�render_template_stringrp�s3���40)�41)�42+�C��}�}�(�(��0�H��3�'�*�*rc�^^^�TRT5 [R"TTRTTS9 SUUU4SjjnU"5n[(a[U5nU$)Nr]c3�># �TRT5Shv�N [R"TTRTTS9 gN&7fr\)�generaterrarb)r#r_r>s���rrs�_stream.<locals>.generate�s:�����$�$�W�-�-�-��������(�G�	43�	.�s�A�?�'A)r)�t.Iterator[str])r`rrarbrr
)r#r>r_rsrs```  r�_streamrv�sW�������(�����C�O�O�h���44�45�46��B��w�
 ��
$��
�Irc�z�[R"5nURRU5n[	X#U5$)awRender a template by name with the given context as a stream.47This returns an iterator of strings, which can be used as a48streaming response from a view.49 50:param template_name_or_list: The name of the template to render. If51    a list is given, the first name to exist will be rendered.52:param context: The variables to make available in the template.53 54.. versionadded:: 2.255)rrfrgrhrvris    r�stream_templaterx�s4���56)�57)�58+�C��}�}�3�3�4I�J�H��3�'�*�*rc�z�[R"5nURRU5n[	X#U5$)aBRender a template from the given source string with the given59context as a stream. This returns an iterator of strings, which can60be used as a streaming response from a view.61 62:param source: The source code of the template to render.63:param context: The variables to make available in the template.64 65.. versionadded:: 2.266)rrfrgrmrvrns    r�stream_template_stringrz�s3���67)�68)�69+�C��}�}�(�(��0�H��3�'�*�*r)r)�dict[str, t.Any])r#rr>rr_r{r)rZ)rj�%str | Template | list[str | Template]r_r(r)rZ)rorZr_r(r)rZ)r#rr>rr_r{r)ru)rjr|r_r(r)ru)rorZr_r(r)ru)#�70__future__r�typing�t�jinja2rrr!rr�globalsr	r71rr�helpersr
�signalsrr�
TYPE_CHECKINGr#r�72sansio.appr�sansio.scaffoldrrr3rdrkrprvrxrzr1rr�<module>r�s���"���1��#�� � ��(�+�&��?�?���)�
� 73�/�74�G�Z�G�T	�+�@�+��+�	�+�	+��	��"��-=����.+�@�+��+��+�&+r
codekingpro/portable-devtools · Team Ai