%PDF- %PDF-
| Direktori : /snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/ |
| Current File : //snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/url.cpython-35.pyc |
Rg$ � @ s� d d l m Z d d l m Z d d l Z d d l m Z d d l m Z d d d d
d d d
g Z e j
d � Z Gd d � d e d e � � Z d d � Z
d d � Z d d � Z d S)� )�absolute_import)�
namedtupleN� )�LocationParseError)�quote�scheme�auth�host�port�path�query�fragmentz[ - ]c
s� e Z d Z d Z f Z d d d d d d d � f d d � Z e d d � � Z e d d � � Z e d d
� � Z e d d � � Z
d
d � Z � S)�Urlzg
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
Nc sK | r | j d � r d | } t t | � j | | | | | | | | � S)N�/)�
startswith�superr �__new__)�clsr r r r
r r r
)� __class__� �2/usr/lib/python3/dist-packages/urllib3/util/url.pyr s
!zUrl.__new__c C s | j S)z@For backwards-compatibility with urlparse. We're nice like that.)r )�selfr r r �hostname s zUrl.hostnamec C s3 | j p d } | j d k r/ | d | j 7} | S)z)Absolute path including the query string.r N�?)r r )r Zurir r r �request_uri! s zUrl.request_uric C s$ | j r d | j | j f S| j S)z(Network location including host and portz%s:%d)r
r )r r r r �netloc+ s z
Url.netlocc C s� | \ } } } } } } } d } | d k r; | | d 7} | d k rU | | d 7} | d k rk | | 7} | d k r� | d t | � 7} | d k r� | | 7} | d k r� | d | 7} | d k 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) r r r r r
r r r
�urlr r r r! 2 s"