HEX
Server: LiteSpeed
System: Linux pl-rocket-da1.hostsila.org 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: etorby24eu (1588)
PHP: 8.3.23
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python2.7/site-packages/flask/templating.pyc
�
n�Dac@s�dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
dd	l	mZd
�Zdefd��YZd
efd��YZ
d�Zd�Zd�ZdS(s�
    flask.templating
    ~~~~~~~~~~~~~~~~

    Implements the bridge to Jinja2.

    :copyright: 2010 Pallets
    :license: BSD-3-Clause
i����(t
BaseLoader(tEnvironment(tTemplateNotFoundi(t_app_ctx_stack(t_request_ctx_stack(tbefore_render_template(ttemplate_renderedcCsatj}tj}i}|dk	r4|j|d<n|dk	r]|j|d<|j|d<n|S(sSDefault template context processor.  Injects `request`,
    `session` and `g`.
    tgtrequesttsessionN(RttopRtNoneRRR	(treqctxtappctxtrv((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyt_default_template_ctx_processors		
RcBseZdZd�ZRS(s�Works like a regular Jinja2 environment but has some additional
    knowledge of how Flask's blueprint works so that it can prepend the
    name of the blueprint to referenced templates if necessary.
    cKs<d|kr|j�|d<ntj||�||_dS(Ntloader(tcreate_global_jinja_loadertBaseEnvironmentt__init__tapp(tselfRtoptions((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR*s(t__name__t
__module__t__doc__R(((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR$stDispatchingJinjaLoadercBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s\A loader that looks for templates in the application and all
    the blueprint folders.
    cCs
||_dS(N(R(RR((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR6scCs0|jjdr |j||�S|j||�S(NtEXPLAIN_TEMPLATE_LOADING(Rtconfigt_get_source_explainedt_get_source_fast(Rtenvironmentttemplate((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyt
get_source9sc	Cs�g}d}xx|j|�D]g\}}y+|j||�}|dkrR|}nWntk
rld}nX|j|||f�qWddlm}||j||�|dk	r�|St|��dS(Ni(t!explain_template_loading_attempts(Rt
_iter_loadersR!RtappendtdebughelpersR"R(	RRR tattemptsttrvtsrcobjRRR"((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR>s


cCs[xH|j|�D]7\}}y|j||�SWqtk
rFqqXqWt|��dS(N(R#R!R(RRR t_srcobjR((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyRSs
ccsj|jj}|dk	r)|j|fVnx:|jj�D])}|j}|dk	r9||fVq9q9WdS(N(Rtjinja_loaderRtiter_blueprints(RR Rt	blueprint((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR#[s	cCs�t�}|jj}|dk	r7|j|j��nxS|jj�D]B}|j}|dk	rGx$|j�D]}|j|�qoWqGqGWt|�S(N(	tsetRR*Rtupdatetlist_templatesR+taddtlist(RtresultRR,R ((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR/es		(	RRRRR!RRR#R/(((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyR1s					
cCsEtj|d|d|�|j|�}tj|d|d|�|S(s)Renders the template and fires the signalR tcontext(RtsendtrenderR(R R3RR((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyt_rendertscKs;tj}|jj|�t|jjj|�||j�S(s�Renders a template from the template folder with the given
    context.

    :param template_name_or_list: the name of the template to be
                                  rendered, or an iterable with template names
                                  the first one existing will be rendered
    :param context: the variables that should be available in the
                    context of the template.
    (RR
Rtupdate_template_contextR6t	jinja_envtget_or_select_template(ttemplate_name_or_listR3tctx((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pytrender_template}s
	cKs;tj}|jj|�t|jjj|�||j�S(sFRenders a template from the given template source string
    with the given context. Template variables will be autoescaped.

    :param source: the source code of the template to be
                   rendered
    :param context: the variables that should be available in the
                    context of the template.
    (RR
RR7R6R8tfrom_string(tsourceR3R;((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pytrender_template_string�s		N(Rtjinja2RRRRtglobalsRRtsignalsRRRRR6R<R?(((s//tmp/pip-build-W6Gm0N/Flask/flask/templating.pyt<module>
s	
C