403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.216.137.32
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/urlmap.cpython-37.pyc
B

b�NH#�@spdZddlmZddlZddlZddlZddlmZddgZdd�Z	d	d
�Z
Gdd�de�ZGdd�de�Z
dS)
z8
Map URL prefixes to WSGI applications.  See ``URLMap``
�)�	DictMixinN)�httpexceptions�URLMap�PathProxyURLMapcKsrd|kr|�d�}n
|�d�}|r0|j||d�}t|d�}x2|��D]&\}}t|�}|j||d�}|||<qDW|S)N�
not_found_app)�global_conf)r)�pop�getZget_appr�items�parse_path_expression)�loaderrZ
local_confrZurlmap�pathZapp_name�app�r�=/opt/alt/python37/lib/python3.7/site-packages/paste/urlmap.py�urlmap_factorys

rcCs�|��}d}}}x�|r�|ddkrT|�d�|s<td��|rHtd��|�d�}q|ddkr�|�d�|svtd��|r�td��|�d�}q|r�td	||df��|�d�}qWd
}|r�d|}|r�|s�td��|d
|7}|r�|r�|d7}||7}|S)z�
    Parses a path expression like 'domain foobar.com port 20 /' or
    just '/foobar' for a path alone.  Returns as an address that
    URLMap likes.
    Nr�domainz,'domain' must be followed with a domain namez'domain' given twice�portz*'port' must be followed with a port numberz'port' given twicez*more than one path given (have %r, got %r)�z	http://%sz/If you give a port, you must also give a domain�:�/)�splitr�
ValueError)r
�partsrr�srrrrsB

rc@speZdZdZddd�Ze�d�Ze�d�Zdd�Z	dd
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)ra�
    URLMap instances are dictionary-like object that dispatch to one
    of several applications based on the URL.

    The dictionary keys are URLs to match (like
    ``PATH_INFO.startswith(url)``), and the values are applications to
    dispatch to.  URLs are matched most-specific-first, i.e., longest
    URL first.  The ``SCRIPT_NAME`` and ``PATH_INFO`` environmental
    variables are adjusted to indicate the new context.

    URLs can also include domains, like ``http://blah.com/foo``, or as
    tuples ``('blah.com', '/foo')``.  This will match domain names; without
    the ``http://domain`` or with a domain of ``None`` any domain will be
    matched (so long as no other explicit domain matches).  NcCsg|_|s|j}||_dS)N)�applicationsr�not_found_application)�selfrrrr�__init__WszURLMap.__init__z//+z^(http|https)://cCs�|�d�}|r4dd�|jD�}dd�tt|��}nd}|d|�d�7}|d	|�d
�7}|d|�d�7}tj|d
t�|�d
�j	}|||�S)Nzpaste.urlmap_objectcSsg|]\}}|�qSrr)�.0�p�arrr�
<listcomp>csz(URLMap.not_found_app.<locals>.<listcomp>zdefined apps: %sz,
  rz
SCRIPT_NAME: %r�SCRIPT_NAMEz
PATH_INFO: %r�	PATH_INFOz
HTTP_HOST: %r�	HTTP_HOST)�comment)
r	r�join�map�reprrZHTTPNotFound�cgi�escapeZwsgi_application)r�environ�start_responseZmapper�matches�extrarrrrr`s
zURLMap.not_found_appTcCs�t|ttf�r0|d}|�|d�d}||fS|rV|�d�sV|j�|�sVtd|��|j�|�}|r�||��d�}d|kr�|�	dd�\}}d|}q�|d}}nd}|j
�d|�}|r�|�d�}||fS)Nr�rz8URL fragments must start with / or http:// (you gave %r)r)
�
isinstance�list�tuple�
normalize_url�
startswith�
domain_url_re�search�AssertionError�endr�norm_url_re�sub�rstrip)r�urlZtrimr�matchrrrr4ps&


zURLMap.normalize_urlcs8dd���fdd�|jD�}|��dd�|D�|_dS)zK
        Make sure applications are sorted with longest URLs first
        cSs0|\\}}}|sdt|�fS|t|�fSdS)N�ÿ)�len)Zapp_descrr=rrrr�key�szURLMap.sort_apps.<locals>.keycsg|]}�|�|f�qSrr)r�desc)rArrr"�sz$URLMap.sort_apps.<locals>.<listcomp>cSsg|]\}}|�qSrr)rZsortablerBrrrr"�sN)r�sort)rZappsr)rAr�	sort_apps�szURLMap.sort_appscCs`|dkr,y
||=Wntk
r&YnXdS|�|�}||krD||=|j�||f�|��dS)N)�KeyErrorr4r�appendrD)rr=r�dom_urlrrr�__setitem__�s

zURLMap.__setitem__cCsN|�|�}x|jD]\}}||kr|SqWtd|d|dp>d|jf��dS)Nz9No application with the url %r (domain: %r; existing: %s)r0r�*)r4rrE)rr=rG�app_urlrrrr�__getitem__�s
zURLMap.__getitem__cCsJ|�|�}x:|jD]"\}}||kr|j�||f�PqWtd|f��dS)NzNo application with the url %r)r4r�removerE)rr=rJrrrr�__delitem__�s
zURLMap.__delitem__cCsdd�|jD�S)NcSsg|]\}}|�qSrr)rrJrrrrr"�szURLMap.keys.<locals>.<listcomp>)r)rrrr�keys�szURLMap.keysc	Cs�|�d|�d����}d|kr0|�dd�\}}n|ddkrBd}nd}|�d	�}|�|d
�d}xx|jD]n\\}}}|r�||kr�||d|kr�qh||ks�|�|d�rh|d|7<|t|�d�|d	<|||�SqhW||d
<|�||�S)Nr%ZSERVER_NAMErr0zwsgi.url_scheme�httpZ80Z443r$Frr#zpaste.urlmap_object)r	�lowerrr4rr5r@r)	rr,r-�hostrZ	path_inforrJrrrr�__call__�s$
zURLMap.__call__)N)T)�__name__�
__module__�__qualname__�__doc__r�re�compiler:r6rr4rDrHrKrMrNrRrrrrrFs




	
c@sBeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	ee�Z
dS)
ra�
    This is a wrapper for URLMap that catches any strings that
    are passed in as applications; these strings are treated as
    filenames (relative to `base_path`) and are passed to the
    callable `builder`, which will return an application.

    This is intended for cases when configuration files can be
    treated as applications.

    `base_paste_url` is the URL under which all applications added through
    this wrapper must go.  Use ``""`` if you want this to not
    change incoming URLs.
    cCs$||_|j�|�|_||_||_dS)N)r(r4�base_paste_url�	base_path�builder)rr(rYrZr[rrrr�szPathProxyURLMap.__init__cCsft|ttf�r(tj�|j|�}|�|�}|j�	|�}|dpD|j
d|j
d|df}||j|<dS)Nrr0)r1�str�unicode�osr
r'rZr[r(r4rY)rr=rZapp_fnrrrrH�s
zPathProxyURLMap.__setitem__cCst|j|�S)N)�getattrr()r�attrrrr�__getattr__�szPathProxyURLMap.__getattr__cCs|jjS)N)r(r)rrrr�not_found_application__get�sz*PathProxyURLMap.not_found_application__getcCs||j_dS)N)r(r)r�valuerrr�not_found_application__set�sz*PathProxyURLMap.not_found_application__setN)rSrTrUrVrrHrarbrd�propertyrrrrrr�s)rV�UserDictrrWr^r*�paster�__all__rrr�objectrrrrr�<module>s)

Youez - 2016 - github.com/yon3zu
LinuXploit