%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/
Upload File :
Create Path :
Current File : //snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/url.cpython-35.pyc



Rg$�@s�ddlmZddlmZddlZddlmZddlmZddd	d
ddd
gZ	ej
d�ZGdd�dede	��Zdd�Z
dd�Zdd�ZdS)�)�absolute_import)�
namedtupleN�)�LocationParseError)�quote�scheme�auth�host�port�path�query�fragmentz[- ]c
s�eZdZdZfZddddddd�fdd�Zedd��Zedd��Zed	d
��Z	edd��Z
d
d�Z�S)�Urlzg
    Datastructure for representing an HTTP URL. Used as a return value for
    :func:`parse_url`.
    Nc	sK|r |jd�r d|}tt|�j||||||||�S)N�/)�
startswith�superr�__new__)�clsrrr	r
rrr
)�	__class__��2/usr/lib/python3/dist-packages/urllib3/util/url.pyrs
!zUrl.__new__cCs|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r	)�selfrrr�hostnameszUrl.hostnamecCs3|jpd}|jdk	r/|d|j7}|S)z)Absolute path including the query string.rN�?)rr)rZurirrr�request_uri!szUrl.request_uricCs$|jrd|j|jfS|jS)z(Network location including host and portz%s:%d)r
r	)rrrr�netloc+s	z
Url.netlocc	Cs�|\}}}}}}}d}|dk	r;||d7}|dk	rU||d7}|dk	rk||7}|dk	r�|dt|�7}|dk	r�||7}|dk	r�|d|7}|dk	r�|d|7}|S)a�
        Convert self into a url

        This function should more or less round-trip with :func:`.parse_url`. The
        returned url may not be exactly the same as the url inputted to
        :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls
        with a blank port will have : removed).

        Example: ::

            >>> U = parse_url('http://google.com/mail/')
            >>> U.url
            'http://google.com/mail/'
            >>> Url('http', 'username:password', 'host.com', 80,
            ... '/path', 'query', 'fragment').url
            'http://username:password@host.com:80/path?query#fragment'
        �Nz://�@�:r�#)�str)	rrrr	r
rrr
�urlrrrr!2s"

zUrl.urlcCs|jS)N)r!)rrrr�__str__ZszUrl.__str__)�__name__�
__module__�__qualname__�__doc__�slotsr�propertyrrrr!r"rr)rrrs
(rcCs�d}d}xP|D]H}|j|�}|dkr7q|dksO||kr|}|}qW|dksw|dkr�|ddfS|d|�||dd�|fS)a�
    Given a string and an iterable of delimiters, split on the first found
    delimiter. Return two split parts and the matched delimiter.

    If not found, then the first part is the full input string.

    Example::

        >>> split_first('foo/bar?baz', '?/=')
        ('foo', 'bar?baz', '/')
        >>> split_first('foo/bar?baz', '123')
        ('foo/bar?baz', '', None)

    Scales linearly with number of delims. Not ideal for large number of delims.
    Nrr�)�find)�sZdelimsZmin_idxZ	min_delim�d�idxrrr�split_first^s


r.cCs�|s
t�Stjdd�|�}d}d}d}d}d}d}d}d|krs|jdd�\}}t|dddg�\}}}	|	r�|	|}d	|kr�|jd	d�\}}|r|d
dkr|jdd�\}}|d7}d
|krf|jd
d�\}
}|s0|
}|r]|j�sNt|��t|�}qyd}n|ry|ry|}|s�t|||||||�Sd|kr�|jdd�\}}d|kr�|jdd�\}}t|||||||�S)a:
    Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
    performed to parse incomplete urls. Fields not provided will be None.

    Partly backwards-compatible with :mod:`urlparse`.

    Example::

        >>> parse_url('http://google.com/mail/')
        Url(scheme='http', host='google.com', port=None, path='/mail/', ...)
        >>> parse_url('google.com:80')
        Url(scheme=None, host='google.com', port=80, path=None, ...)
        >>> parse_url('/foo?bar')
        Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)
    cSst|j��S)N)r�group)�matchrrr�<lambda>�szparse_url.<locals>.<lambda>Nz://r)rrrrr�[�]r)	r�!_contains_disallowed_url_pchar_re�sub�splitr.�rsplit�isdigitr�int)r!rrr	r
rr
rZpath_ZdelimZ_hostrrr�	parse_urlsL!

	
r:cCs(t|�}|jpd|j|jfS)z5
    Deprecated. Use :func:`.parse_url` instead.
    Zhttp)r:rrr
)r!�prrr�get_host�sr<)Z
__future__r�collectionsr�re�
exceptionsrZsix.moves.urllib.parserZ	url_attrs�compiler4rr.r:r<rrrr�<module>sP!]

Zerion Mini Shell 1.0