§
    cÌc…  ã            	       óú  — d Z ddlZddlZddlZddlmZmZ ddlmZ	 ddl
mZmZ ddlZ G d„ dej        ¦  «        Z G d	„ d
ej        ¦  «        Z G d„ dej        ¦  «        ZdGd„ZdGdededefd„Ze	j        Ze	j        Ze	j        Ze	j        ZdHdeeef         dedefd„Zdededefd„Zd„ Zd„ Zdedefd„Zd„ Z d„ Z!d„ Z"d „ Z#d!„ Z$e"Z%e!Z& e'd"¦  «        Z( e'd#¦  «        Z)ej*        d$k    re$Z%e#Z&e)Z( ej+        d%¦  «        Z, ej+        d&¦  «        Z-d'„ Z.d(„ Z/d)„ Z0d*„ Z1dGdededeeef         fd+„Z2d,„ Z3d-„ Z4d.„ Z5d/„ Z6d0„ Z7d1„ Z8d2„ Z9d3„ Z:d4Z;d5„ e;D ¦   «         Z<d6„ e<D ¦   «         d7„ e<D ¦   «         z   Z= e>d8„  e?d9¦  «        D ¦   «         d:„  e?d9¦  «        D ¦   «         z   ¦  «        Z@e@ A                    d;„ e=D ¦   «         ¦  «          eBd<¦  «        ZC eBd=¦  «        ZDd>„ ZEd?„ ZFd@„ ZGdA„ ZHdB„ ZIdC„ ZJ G dD„ dE¦  «        ZKdF„ ZLdS )Iz5A collection of function for handling URL operations.é    N)ÚTupleÚUnion)Úparseé   )ÚerrorsÚosutilsc                   ó   — e Zd ZdZdS )Ú
InvalidURLz6Invalid url supplied to transport: "%(path)s"%(extra)sN)Ú__name__Ú
__module__Ú__qualname__Ú_fmt© ó    ú1/usr/lib/python3/dist-packages/breezy/urlutils.pyr
   r
   #   s   € € € € € àC€D€D€Dr   r
   c                   ó   — e Zd ZdZd„ ZdS )ÚInvalidURLJoinz>Invalid URL join request: %(reason)s: %(base)r + %(join_args)rc                 ór   — || _         || _        || _        t          j                             | ||¦  «         d S ©N)ÚreasonÚbaseÚ	join_argsr   Ú	PathErrorÚ__init__)Úselfr   r   r   s       r   r   zInvalidURLJoin.__init__,   s8   € ØˆŒØˆŒ	Ø"ˆŒÝÔ×!Ò! $¨¨fÑ5Ô5Ð5Ð5Ð5r   N©r   r   r   r   r   r   r   r   r   r   (   s(   € € € € € àK€Dð6ð 6ð 6ð 6ð 6r   r   c                   ó   — e Zd ZdZd„ ZdS )ÚInvalidRebaseURLsz3URLs differ by more than path: %(from_)r and %(to)rc                 ód   — || _         || _        t          j                             | |d¦  «         d S )NzURLs differ by more than path.)Úfrom_Útor   r   r   )r   r    r!   s      r   r   zInvalidRebaseURLs.__init__7   s=   € ØˆŒ
ØˆŒÝÔ×!Ò!Ø�%Ð9ñ	;ô 	;ð 	;ð 	;ð 	;r   Nr   r   r   r   r   r   3   s(   € € € € € à@€Dð;ð ;ð ;ð ;ð ;r   r   Tc                 ó0   — t          | |¬¦  «        d         S )av  Return the last component of a URL.

    Args:
      url: The URL in question
      exclude_trailing_slash: If the url looks like "path/to/foo/"
        ignore the final slash and return 'foo' rather than ''
    Returns:
      Just the final component of the URL. This can return ''
      if you don't exclude_trailing_slash, or if you are at the
      root of the URL.
    ©Úexclude_trailing_slashr   ©Úsplit©Úurlr$   s     r   Úbasenamer)   >   ó   € õ �Ð-CÐDÑDÔDÀQÔGÐGr   r(   r$   Úreturnc                 ó0   — t          | |¬¦  «        d         S )a4  Return the parent directory of the given path.

    Args:
      url: Relative or absolute URL
      exclude_trailing_slash: Remove a final slash
        (treat http://host/foo/ as http://host/foo, but
        http://host/ stays http://host/)
    Returns: Everything in the URL except the last path chunk
    r#   r   r%   r'   s     r   Údirnamer-   M   r*   r   ú/~ÚrelpathÚsafec                 ó$   — t          | |¬¦  «        S )z!Escape relpath to be a valid url.©r0   )Úquote)r/   r0   s     r   Úescaper4   b   s   € å�˜tÐ$Ñ$Ô$Ð$r   r   Úpathc                 ó,  — t          | ¦  «        t          k     rt          d| t          fz  ¦  «        ‚t          j        t          | ¦  «        ¦  «        } t          j        t          |¦  «        ¦  «        }t          t          j        | |¦  «        ¦  «        S )zCompute just the relative sub-portion of a url

    This assumes that both paths are already fully specified file:// URLs.
    zVLength of base (%r) must equal or exceed the platform minimum url length (which is %d))ÚlenÚMIN_ABS_FILEURL_LENGTHÚ
ValueErrorr   ÚnormpathÚlocal_path_from_urlr4   r/   )r   r5   s     r   Úfile_relpathr<   g   sŠ   € õ
 ˆ4�y„yÕ)Ò)Ð)Ýð QàÕ 6Ð7ñ8ñ 9ô 9ð 	9õ ÔÕ/°Ñ5Ô5Ñ6Ô6€DÝÔÕ/°Ñ5Ô5Ñ6Ô6€DÝ•'”/ $¨Ñ-Ô-Ñ.Ô.Ð.r   c                 ó8  — t                                | ¦  «        }|sdS |                     d¦  «        }|                     d¦  «        }|                     d¦  «        }|dk    rt	          |¦  «        dfS t	          |¦  «        ||                     d¦  «        z   fS )z®Find the scheme separator (://) and the first path separator

    This is just a helper functions for other path utilities.
    It could probably be replaced by urlparse
    )NNÚschemer5   ú/éÿÿÿÿN)Ú_url_scheme_reÚmatchÚgroupÚfindr7   Ústart)r(   Úmr>   r5   Úfirst_path_slashs        r   Ú_find_scheme_and_separatorrH   u   s“   € õ 	×Ò˜SÑ!Ô!€AØð Øˆzà�WŠW�XÑÔ€FØ�7Š7�6‰?Œ?€Dð —y’y ‘~”~ÐØ˜2ÒÐÝ�6‰{Œ{˜DÐ Ð Ýˆv‰;Œ;Ð(¨1¯7ª7°6©?¬?Ñ:Ð:Ð:r   c                 ó:   — t                                | ¦  «        duS )z,Tests whether a URL is in actual fact a URL.N)rA   rB   ©r(   s    r   Úis_urlrK   Š   s   € å×Ò Ñ$Ô$¨DÐ0Ð0r   c                 ó0  — |s| S t          | ¦  «        \  }}|€|€d}n|€t          | ¦  «        }| |d…         }|D ]O}t          |¦  «        \  }}|€|€d}n|€t          |¦  «        }|�|} ||d…         }|}|}Œ?t          ||¦  «        }ŒP| d|…         |z   S )a•  Create a URL by joining sections.

    This will normalize '..', assuming that paths are absolute
    (it assumes no symlinks in either path)

    If any of *args is an absolute URL, it will be treated correctly.
    Example:
        join('http://foo', 'http://bar') => 'http://bar'
        join('http://foo', 'bar') => 'http://foo/bar'
        join('http://foo', 'bar', '../baz') => 'http://foo/baz'
    Nr   )rH   r7   Újoinpath)r   ÚargsÚ
scheme_endÚ
path_startr5   ÚargÚarg_scheme_endÚarg_path_starts           r   ÚjoinrT   �   sâ   € ð ð ØˆÝ7¸Ñ=Ô=Ñ€J�
ØÐ˜jÐ0Øˆ
ˆ
Ø	Ð	Ý˜‘Y”Yˆ
Ø�
��Ô€DØð 'ð 'ˆÝ)CÀCÑ)HÔ)HÑ&ˆ˜ØÐ! nÐ&<ØˆNˆNØÐ#Ý  ™XœXˆNØÐ%ØˆDØ�~��Ô'ˆDØ'ˆJØ'ˆJˆJå˜D #Ñ&Ô&ˆDˆDØ���Ô˜tÑ#Ð#r   c                 óÔ  — |                       d¦  «        }t          |¦  «        dk    r |d         dk    r|                     ¦   «          |D ]€}|                     d¦  «        rg }|                      d¦  «        D ]Q}|dk    rŒ	|dk    r-|dgk    rt	          d| |¦  «        ‚|                     ¦   «          Œ<|                     |¦  «         ŒRŒ�|dgk    rdS d                     |¦  «        S )a‡  Join URL path segments to a URL path segment.

    This is somewhat like osutils.joinpath, but intended for URLs.

    XXX: this duplicates some normalisation logic, and also duplicates a lot of
    path handling logic that already exists in some Transport implementations.
    We really should try to have exactly one place in the code base responsible
    for combining paths of URLs.
    r?   r   r@   Ú ú.ú..zCannot go above root)r&   r7   ÚpopÚ
startswithr   ÚappendrT   )r   rN   r5   rQ   Úchunks        r   rM   rM   ³   s  € ð �:Š:�c‰?Œ?€DÝ
ˆ4�y„y�1‚}€}˜˜bœ Rš˜à�Š‰
Œ
ˆ
Øð #ð #ˆØ�>Š>˜#ÑÔð 	ØˆDØ—Y’Y˜s‘^”^ð 		#ð 		#ˆEØ˜Š|ˆ|ØØ˜$’�Ø˜B˜4’<�<Ý(Ð)?Ø)-¨tñ5ô 5ð 5à—’‘
”
�
�
à—’˜EÑ"Ô"Ð"Ð"ð		#ð �ˆt‚|€|Øˆsà�xŠx˜‰~Œ~Ðr   c                 ó  — t          | ¦  «        } d}|                      |¦  «        r| t          |¦  «        dz
  d…         }n<|                      d¦  «        st          | d¦  «        ‚| t          d¦  «        d…         }t	          |¦  «        S )z8Convert a url like file:///path/to/foo into /path/to/foozfile://localhost/r   Núfile:///z8local urls must start with file:/// or file://localhost/úfile://)Ústrip_segment_parametersrZ   r7   r
   Úunescape)r(   Úfile_localhost_prefixr5   s      r   Ú_posix_local_path_from_urlrc   Õ   s›   € å
" 3Ñ
'Ô
'€CØ/ÐØ
‡~‚~Ð+Ñ,Ô,ð $Ø•3Ð,Ñ-Ô-°Ñ1Ð2Ð2Ô3ˆˆØ�^Š^˜JÑ'Ô'ð $ÝØÐKñMô Mð 	Mð •3�y‘>”>�?�?Ô#ˆå�D‰>Œ>Ðr   c                 óJ   — dt          t          j        | ¦  «        ¦  «        z   S )zŽConvert a local path like ./foo into a URL like file:///path/to/foo

    This also handles transforming escaping unicode characters, etc.
    r_   )r4   Ú	posixpathÚabspath)r5   s    r   Ú_posix_local_path_to_urlrg   ä   s"   € ð •v�iÔ/°Ñ5Ô5Ñ6Ô6Ñ6Ð6r   c                 ó,  — |                       d¦  «        st          | d¦  «        ‚t          | ¦  «        } | t          d¦  «        d…         }|                      d¦  «        s5|d         dk    s
|d         d	v rt          | d
¦  «        ‚t	          |¦  «        S |dk    rdS t          |¦  «        dk     s |d         dvs|d         d	vs|d         dk    rt          | d¦  «        ‚|d                              ¦   «         dz   t	          |dd…         ¦  «        z   S )z=Convert a url like file:///C:/path/to/foo into C:/path/to/foor_   zJlocal urls must start with file:///, UNC path urls must start with file://úfile:Nz///é   r?   é   z|:z.Win32 UNC path urls have form file://HOST/pathé   Ú4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZé   é   zGWin32 file urls start with file:///x:/, where x is a valid drive letterú:)rZ   r
   r`   r7   ra   Úupper)r(   Ú	win32_urls     r   Ú_win32_local_path_from_urlrs   î   sV  € à�>Š>˜)Ñ$Ô$ð BÝ˜ð Añ Bô Bð 	Bå
" 3Ñ
'Ô
'€Cà•C˜‘L”L�M�MÔ"€Ià×Ò Ñ&Ô&ð #Ø�aŒL˜CÒÐØ˜Q”< 4Ð'Ð'Ý˜Sð #;ñ <ô <ð <å˜	Ñ"Ô"Ð"ð �EÒÐØˆsõ 	ˆI‰Œ˜ÒÐØ�QŒ<ð !=ð >ð >à�!Œ˜DÐ Ð Ø˜Œ|˜sÒ"Ð"Ý˜ð Iñ Jô Jð 	Jà�QŒ<×ÒÑÔ #Ñ%­°¸1¸2¸2´Ñ(?Ô(?Ñ?Ð?r   c                 ó  — | dk    rdS t          j        | ¦  «        }|                     d¦  «        rdt          |¦  «        z   S dt	          |d                              ¦   «         ¦  «        z   dz   t          |dd…         ¦  «        z   S )	z‘Convert a local path like ./foo into a URL like file:///C:/path/to/foo

    This also handles transforming escaping unicode characters, etc.
    r?   r^   z//ri   r   rp   rj   N)r   Ú_win32_abspathrZ   r4   Ústrrq   )r5   Ú
win32_paths     r   Ú_win32_local_path_to_urlrx     s�   € ð ˆs‚{€{ØˆzåÔ'¨Ñ-Ô-€Jà×Ò˜TÑ"Ô"ð ,Ø� 
Ñ+Ô+Ñ+Ð+Ø�˜Z¨œ]×0Ò0Ñ2Ô2Ñ3Ô3Ñ3°cÑ9Ý�:˜a˜b˜b”>Ñ"Ô"ñ#ð $r   r^   zfile:///C:/Úwin32z)^(?P<scheme>[^:/]{2,}):(//)?(?P<path>.*)$z(%[0-9a-fA-F]{2})c                 óÚ   — |                       d¦  «        dd…         }t          t          |d¦  «        ¦  «        }|t          v r|S |                       d¦  «                             ¦   «         S )ztre.sub callback to convert hex-escapes to plain characters (if safe).

    e.g. '%7E' will be converted to '~'.
    r   r   Né   )rC   ÚchrÚintÚ_url_dont_escape_charactersrq   )ÚmatchobjÚ
hex_digitsÚchars      r   Ú_unescape_safe_charsr‚   3  sd   € ð
 —’ Ñ"Ô" 1 2 2Ô&€JÝ�s�:˜rÑ"Ô"Ñ#Ô#€DØÕ*Ð*Ð*Øˆà�~Š~˜aÑ Ô ×&Ò&Ñ(Ô(Ð(r   c           	      óþ  — t          | ¦  «        \  }}|€t          | ¦  «        S | d|…         }| |d…         }t          | t          ¦  «        sf| D ]}|t          vrt          | d|z  ¦  «        ‚Œt                               t          |¦  «        }t          |d 	                    |¦  «        z   ¦  «        S t          |¦  «        }t          t          |¦  «        ¦  «        D ]Y}||         t          vrHd 	                    d„ t          ||                              d¦  «        ¦  «        D ¦   «         ¦  «        ||<   ŒZd 	                    |¦  «        }t                               t          |¦  «        }t          ||z   ¦  «        S )aN  Make sure that a path string is in fully normalized URL form.

    This handles URLs which have unicode characters, spaces,
    special characters, etc.

    It has two basic modes of operation, depending on whether the
    supplied string starts with a url specifier (scheme://) or not.
    If it does not have a specifier it is considered a local path,
    and will be converted into a file:/// url. Non-ascii characters
    will be encoded using utf-8.
    If it does have a url specifier, it will be treated as a "hybrid"
    URL. Basically, a URL that should have URL special characters already
    escaped (like +?&# etc), but may have unicode characters, etc
    which would not be valid in a real URL.

    Args:
      url: Either a hybrid URL or a local path
    Returns: A normalized URL which only includes 7-bit ASCII characters.
    Nz7URLs can only contain specific safe characters (not %r)rV   c                 ó   — g | ]}d |z  ‘ŒS )z%%%02Xr   ©Ú.0Úcs     r   ú
<listcomp>z!normalize_url.<locals>.<listcomp>g  s   € ÐPÐPÐP !�˜A‘ÐPÐPÐPr   úutf-8)rH   Úlocal_path_to_urlÚ
isinstancerv   Ú_url_safe_charactersr
   Ú_url_hex_escapes_reÚsubr‚   rT   ÚlistÚranger7   Ú	bytearrayÚencode)r(   rO   rP   Úprefixr5   r‡   Ú
path_charsÚis           r   Únormalize_urlr–   @  sŽ  € õ( 8¸Ñ<Ô<Ñ€J�
ØÐÝ  Ñ%Ô%Ð%Ø��*�Ô€FØˆzˆ{ˆ{Ô€DÝ�c�3ÑÔð +Øð 	Bð 	BˆAØÕ,Ð,Ð,Ý  ð '=Ø?@ñ'Añ Bô Bð Bð -õ #×&Ò&Õ';¸TÑBÔBˆÝ�6˜BŸGšG D™MœMÑ)Ñ*Ô*Ð*õ �d‘”€Jå•3�z‘?”?Ñ#Ô#ð Rð RˆØ�aŒ=Õ 4Ð4Ð4ØŸGšGØPÐP¥y°¸A´×1EÒ1EÀgÑ1NÔ1NÑ'OÔ'OÐPÑPÔPñRô RˆJ�q‰Møà�7Š7�:ÑÔ€DÝ×"Ò"Õ#7¸Ñ>Ô>€DÝˆv˜‰}ÑÔÐr   c                 ó  — t          | ¦  «        \  }}|€|S t          |¦  «        \  }}|€|S | d|…         }|d|…         }||k    r|S t          j        dk    r.|dk    r(| |dz   |dz   …         }||dz   |dz   …         }||k    r|S | |dz   d…         }	||dz   d…         }
|	                     d¦  «        r
|	dd…         }	|	                     d¦  «        }|
                     d¦  «        }|dgk    rg }|dgk    rg }g }t          ||¦  «        D ]"\  }}||k    r n|                     |¦  «         Œ#t          |¦  «        }d	„ ||d…         D ¦   «         }|                     ||d…         ¦  «         d 	                    |¦  «        pd
S )z¦Return a path to other from base.

    If other is unrelated to base, return other. Else return a relative path.
    This assumes no symlinks as part of the url.
    Nry   r_   r   rk   r?   r@   rV   c                 ó   — g | ]}d ‘ŒS )rX   r   )r†   Úxs     r   rˆ   z relative_url.<locals>.<listcomp>›  s   € Ð?Ð?Ð? �tÐ?Ð?Ð?r   rW   )
rH   ÚsysÚplatformÚendswithr&   Úzipr[   r7   ÚextendrT   )r   ÚotherÚdummyÚbase_first_slashÚother_first_slashÚbase_schemeÚother_schemeÚ
base_driveÚother_driveÚ	base_pathÚ
other_pathÚbase_sectionsÚother_sectionsÚoutput_sectionsÚbÚoÚ	match_lens                    r   Úrelative_urlr¯   m  s  € õ 9¸Ñ>Ô>Ñ€EÐØÐØˆå9¸%Ñ@Ô@Ñ€EÐØÐ Øˆð Ð(Ð(Ð(Ô)€KØÐ+Ð+Ð+Ô,€LØ�lÒ"Ð"ØˆÝ	Œ˜Ò	 Ð	  [°IÒ%=Ð%=ØÐ*¨QÑ.Ð/?À!Ñ/CÐCÔDˆ
ØÐ-°Ñ1Ð2CÀaÑ2GÐGÔHˆØ˜Ò$Ð$ØˆLàÐ%¨Ñ)Ð*Ð*Ô+€IØÐ(¨1Ñ,Ð-Ð-Ô.€Jà×Ò˜#ÑÔð #Ø˜c˜r˜c”Nˆ	à—O’O CÑ(Ô(€MØ×%Ò% cÑ*Ô*€Nà˜˜ÒÐØˆØ˜"˜ÒÐØˆà€OÝ�M >Ñ2Ô2ð "ð "‰ˆˆ1Ø�Š6ˆ6ØˆEØ×Ò˜qÑ!Ô!Ð!Ð!å�OÑ$Ô$€IØ?Ð? ]°9°:°:Ô%>Ð?Ñ?Ô?€OØ×Ò˜>¨)¨*¨*Ô5Ñ6Ô6Ð6à�8Š8�OÑ$Ô$Ð+¨Ð+r   c                 ó°   — t          |¦  «        dk     s|d         dvs|d         dk    rt          | |z   d¦  «        ‚| |dd…         z  } |dd…         }| |fS )	z<On win32 the drive letter needs to be added to the url base.rn   rj   z:|rk   r?   z(win32 file:/// paths need a drive letterr   N)r7   r
   )Úurl_baser5   s     r   Ú_win32_extract_drive_letterr²   ¡  st   € õ ˆ4�y„y�1‚}€}˜˜Qœ tÐ+Ð+¨t°A¬w¸#ª~¨~Ý˜ D™ØCñEô Eð 	Eà��Q�q�S”	Ñ€HØ���Œ8€DØ�Tˆ>Ðr   c                 óÜ  — t          | ¦  «        \  }}|€;|€5|r|                      d¦  «        r
| dd…         } t          j        | ¦  «        S | dfS | d|…         }| |d…         }t          j        dk    r(|                      d¦  «        rt          ||¦  «        \  }}|r2t          |¦  «        dk    r|                     d¦  «        r
|dd…         }t          j        |¦  «        \  }}||z   |fS )af  Split a URL into its parent directory and a child directory.

    Args:
      url: A relative or absolute URL
      exclude_trailing_slash: Strip off a final '/' if it is part
        of the path (but not if it is part of the protocol specification)

    Returns: (parent_url, child_dir).  child_dir may be the empty string if
        we're at the root.
    Nr?   r@   rV   ry   r^   r   )	rH   rœ   re   r&   rš   r›   rZ   r²   r7   )r(   r$   Ú
scheme_locrG   r±   r5   ÚheadÚtails           r   r&   r&   ­  s  € õ $>¸cÑ#BÔ#BÑ €JÐ àÐàÐà%ð ¨#¯,ª,°sÑ*;Ô*;ð Ø˜#˜2˜#”h�Ý”? 3Ñ'Ô'Ð'ð ˜�7ˆNð Ð$Ð$Ð$Ô%€HØÐÐ Ð Ô!€Då
„|�wÒÐ 3§>¢>°*Ñ#=Ô#=Ðõ 5°X¸tÑDÔD‰ˆ�$ð ð ¥# d¡)¤)¨a¢- -°D·M²MÀ#Ñ4FÔ4F -Ø�C�R�CŒyˆÝ” Ñ&Ô&�J€Dˆ$Ø�d‰?˜DÐ Ð r   c                 óô   — t          | ¦  «        }|                     d|                     d¦  «        dz   ¦  «        }|dk    r| g fS |d|…         d„ ||dz   d…                              d¦  «        D ¦   «         fS )zˆSplit the subsegment of the last segment of a URL.

    Args:
      url: A relative or absolute URL
    Returns: (url, subsegments)
    ú,r?   r   r@   Nc                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )rv   )r†   Úss     r   rˆ   z0split_segment_parameters_raw.<locals>.<listcomp>æ  s   € ÐAÐAÐA˜�S�‰VŒVÐAÐAÐAr   )Ústrip_trailing_slashrD   Úrfindr&   )r(   ÚlurlÚsegment_starts      r   Úsplit_segment_parameters_rawr¿   Ö  s�   € õ   Ñ$Ô$€Dà—I’I˜c 4§:¢:¨c¡?¤?°QÑ#6Ñ7Ô7€MØ˜ÒÐØ�RˆyÐØ��-�Ô ØAÐA˜T -°!Ñ"3Ð"4Ð"4Ô5×;Ò;¸CÑ@Ô@ÐAÑAÔAðCð Cr   c                 óH  — t          | ¦  «        \  }}i }|D ]ˆ}	 |                     dd¦  «        \  }}n# t          $ r t          | d¦  «        ‚w xY wt	          |t
          ¦  «        st          |¦  «        ‚t	          |t
          ¦  «        st          |¦  «        ‚|||<   Œ‰||fS )z—Split the segment parameters of the last segment of a URL.

    Args:
      url: A relative or absolute URL
    Returns: (url, segment_parameters)
    ú=r   zmissing = in subsegment)r¿   r&   r9   r
   r‹   rv   Ú	TypeError)r(   Úbase_urlÚsubsegmentsÚ
parametersÚ
subsegmentÚkeyÚvalues          r   Úsplit_segment_parametersrÉ   é  sÊ   € õ ;¸3Ñ?Ô?Ñ€Xˆ{Ø€JØ!ð 	 ð 	 ˆ
ð	=Ø%×+Ò+¨C°Ñ3Ô3‰LˆS�%�%øÝð 	=ð 	=ð 	=Ý˜SÐ";Ñ<Ô<Ð<ð	=øøøå˜#�sÑ#Ô#ð 	!Ý˜C‘.”.Ð Ý˜%¥Ñ%Ô%ð 	#Ý˜EÑ"Ô"Ð"Øˆ
�3‰ˆØ�jÐ!Ð!s	   š4´Ac                 ó*   — t          | ¦  «        \  }}|S )zoStrip the segment parameters from a URL.

    Args:
      url: A relative or absolute URL
    Returns: url
    )r¿   )r(   rÃ   rÄ   s      r   r`   r`   ÿ  s   € õ 9¸Ñ=Ô=Ñ€HˆkØ€Or   c                 ó¾   — |s| S |D ]>}t          |t          ¦  «        st          d|z  ¦  «        ‚d|v rt          d| |¦  «        ‚Œ?d                     | f|z   ¦  «        S )a  Create a new URL by adding subsegments to an existing one.

    This adds the specified subsegments to the last path in the specified
    base URL. The subsegments should be bytestrings.

    :note: You probably want to use join_segment_parameters instead.
    z!Subsegment %r is not a bytestringr¸   z, exists in subsegments)r‹   rv   rÂ   r   rT   )r   rÄ   rÆ   s      r   Újoin_segment_parameters_rawrÌ   
  sŒ   € ð ð ØˆØ!ð 4ð 4ˆ
Ý˜*¥cÑ*Ô*ð 	NÝÐ?À*ÑLÑMÔMÐMØ�*ÐÐÝ Ð!:Ø!% {ñ4ô 4ð 4ð ð �8Š8�T�G˜kÑ)Ñ*Ô*Ð*r   c                 óÌ  — t          | ¦  «        \  }}i }|                     |¦  «         |                     ¦   «         D ]q\  }}t          |t          ¦  «        st          d|z  ¦  «        ‚t          |t          ¦  «        st          d|›d|›d�¦  «        ‚d|v rt          d| |¦  «        ‚|||<   Œrt          |gd„ t          |                     ¦   «         ¦  «        D ¦   «         ¢R Ž S )aH  Create a new URL by adding segment parameters to an existing one.

    The parameters of the last segment in the URL will be updated; if a
    parameter with the same key already exists it will be overwritten.

    Args:
      url: A URL, as string
      parameters: Dictionary of parameters, keys and values as bytestrings
    zparameter key %r is not a strzparameter value z for z is not a strrÁ   z= exists in parameter keyc                 ó   — g | ]}d |z  ‘ŒS )z%s=%sr   )r†   Úitems     r   rˆ   z+join_segment_parameters.<locals>.<listcomp>5  s   € ÐJÐJÐJ 4�˜$‘ÐJÐJÐJr   )	rÉ   ÚupdateÚitemsr‹   rv   rÂ   r   rÌ   Úsorted)r(   rÅ   r   Úexisting_parametersÚnew_parametersrÇ   rÈ   s          r   Újoin_segment_parametersrÕ     s(  € õ #;¸3Ñ"?Ô"?Ñ€TÐØ€NØ×ÒÐ-Ñ.Ô.Ð.Ø ×&Ò&Ñ(Ô(ð 	$ð 	$‰
ˆˆUÝ˜#�sÑ#Ô#ð 	CÝÐ;¸cÑAÑBÔBÐBÝ˜%¥Ñ%Ô%ð 	*Ý�)Ø"˜U˜U C C Cð)ñ *ô *ð *à�#ˆ:ˆ:Ý Ð!<¸cØ!+ñ-ô -ð -à#ˆ�sÑÐÝ&ØðLØJÐJ­6°.×2FÒ2FÑ2HÔ2HÑ+IÔ+IÐJÑJÔJðLð Lð Lð Lr   c                 óJ   — t          | ¦  «        t          k    r
| dd…         S | S )z$Strip slashes after the drive letterNr@   )r7   ÚWIN32_MIN_ABS_FILEURL_LENGTHrJ   s    r   Ú!_win32_strip_local_trailing_slashrØ   8  s&   € å
ˆ3�x„xÕ.Ò.Ð.Ø�3�B�3Œxˆàˆ
r   c                 ó  — |                       d¦  «        s| S t          j        dk    r$|                      d¦  «        rt	          | ¦  «        S t          | ¦  «        \  }}|€
| dd…         S |�|t          | ¦  «        dz
  k    r| S | dd…         S )a  Strip trailing slash, except for root paths.

    The definition of 'root path' is platform-dependent.
    This assumes that all URLs are valid netloc urls, such that they
    form:
    scheme://host/path
    It searches for ://, and then refuses to remove the next '/'.
    It can also handle relative paths
    Examples:
        path/to/foo       => path/to/foo
        path/to/foo/      => path/to/foo
        http://host/path/ => http://host/path
        http://host/path  => http://host/path
        http://host/      => http://host/
        file:///          => file:///
        file:///foo/      => file:///foo
        # This is unique on win32 platforms, and is the only URL
        # format which does it differently.
        file:///c|/       => file:///c:/
    r?   ry   r_   Nr@   r   )rœ   rš   r›   rZ   rØ   rH   r7   )r(   r´   rG   s      r   r»   r»   @  s    € ð* �<Š<˜ÑÔð àˆ
Ý
„|�wÒÐ 3§>¢>°)Ñ#<Ô#<ÐÝ0°Ñ5Ô5Ð5å#=¸cÑ#BÔ#BÑ €JÐ ØÐð �3�B�3ŒxˆàÐÐ#3µs¸3±x´xÀ!±|Ò#CÐ#Cð ˆ
àˆs�ˆsŒ8€Or   c                 óì   — t          | t          ¦  «        rL	 |                      d¦  «         n5# t          $ r(}t	          | d                     |¦  «        ¦  «        ‚d}~ww xY wt          j        | ¦  «        S )zRUnescape relpath from url format.

    This returns a Unicode path from a URL
    Úasciiz!URL was not a plain ASCII url: {}N)r‹   rv   r’   ÚUnicodeErrorr
   ÚformatÚurlparseÚunquote)r(   Úes     r   ra   ra   i  s‘   € õ �#•sÑÔð Dð	DØ�JŠJ�wÑÔÐÐøÝð 	Dð 	Dð 	DÝØÐ8×?Ò?ÀÑBÔBñDô Dð Døøøøð	Døøøõ Ô˜CÑ Ô Ð s   —- ­
A·#AÁAz;/?:@&=+$,#c                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )Úordr…   s     r   rˆ   rˆ   �  s   € Ð4Ð4Ð4˜a•3�q‘6”6Ð4Ð4Ð4r   c                 ó   — g | ]}d |z  ‘ŒS ©z%02xr   ©r†   r­   s     r   rˆ   rˆ   ‚  s   € Ð7Ð7Ð7 !�6˜A‘:Ð7Ð7Ð7r   c                 ó   — g | ]}d |z  ‘ŒS ©z%02Xr   rå   s     r   rˆ   rˆ   ƒ  s   € Ð9Ð9Ð9 A�V˜a‘ZÐ9Ð9Ð9r   c                 ó8   — g | ]}d |z  t          |g¦  «        f‘ŒS rä   ©Úbytesrå   s     r   rˆ   rˆ   „  s)   € ÐFÐFÐF°a˜& 1™*¥e¨Q¨C¡j¤jÐ1ÐFÐFÐFr   é   c                 ó8   — g | ]}d |z  t          |g¦  «        f‘ŒS rç   ré   rå   s     r   rˆ   rˆ   …  s)   € ÐIÐIÐI¸˜V a™Z­°¨s©¬Ð4ÐIÐIÐIr   c              #   óJ   K  — | ]}|d |                      d¦  «        z   fV — ŒdS )ó   %rÛ   N)r’   )r†   Úhexs     r   ú	<genexpr>rð   ‡  sL   è è € ð 3ð 3Øð ˜d S§Z¢Z°Ñ%8Ô%8Ñ8Ð9ð 3ð 3ð 3ð 3ð 3ð 3r   zBabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~zSabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-!~*'()/;?:@&=+$,%#c           	      ó  — |                       d¦  «        }|d                              d¦  «        |d<   t          dt          |¦  «        ¦  «        D ]È}||         }	 t          |dd…                  ||<   ny# t
          $ r& d|dd…                              d¦  «        z   ||<   Y nJt          $ r> t          t          |dd…         d¦  «        ¦  «                             d¦  «        ||<   Y nw xY w||xx         |dd…                              d¦  «        z  cc<   ŒÉd	 	                    |¦  «        }	 | 
                    d¦  «        }	 |                     |¦  «         |S # t          $ r | cY S w xY w# t          $ r | cY S w xY w)
züUnescape a segment for display.

    Helper for unescape_for_display

    Args:
      url: A 7-bit ASCII URL
      encoding: The final output encoding

    Returns: A unicode string which can be safely encoded into the
         specified encoding.
    ú%r   r‰   r   Nrj   rî   r{   r   )r&   r’   r�   r7   Ú_hex_display_mapÚKeyErrorÚUnicodeDecodeErrorr|   r}   rT   ÚdecodeÚUnicodeEncodeError)ÚsegmentÚencodingÚescaped_chunksÚjrÏ   Ú	unescapedÚdecodeds          r   Ú_unescape_segment_for_displayrþ   ž  sÜ  € ð —]’] 3Ñ'Ô'€NØ& qÔ)×0Ò0°Ñ9Ô9€N�1ÑÝ�1•c˜.Ñ)Ô)Ñ*Ô*ð 	8ð 	8ˆØ˜aÔ ˆð	GÝ 0°°b°q°b´Ô :ˆN˜1ÑÐøÝð 	Bð 	Bð 	Bà $¨¨R¨a¨R¬¯ª¸Ñ(@Ô(@Ñ AˆN˜1ÑÐÐÝ!ð 	Gð 	Gð 	GÝ #¥C¨¨R¨a¨R¬°"Ñ$5Ô$5Ñ 6Ô 6× =Ò =¸gÑ FÔ FˆN˜1ÑÐÐð	Gøøøà�qÐÐÔ˜d 1 2 2œhŸošo¨gÑ6Ô6Ñ7ÐÐÑÐØ—’˜Ñ(Ô(€IðØ×"Ò" 7Ñ+Ô+ˆð	Ø�NŠN˜8Ñ$Ô$Ð$ð ˆNøõ "ð 	ð 	ð 	ð ˆNˆNˆNð	øøøøõ ð ð ð ð ˆˆˆðøøøs=   ÁA5Á5-C+Â$AC+Ã*C+Ä0E/ ÅE ÅE,Å+E,Å/E>Å=E>c                 ó†  — |€t          d¦  «        ‚|                      d¦  «        r9	 t          | ¦  «        }|                     |¦  «         |S # t          $ r | cY S w xY w|                      d¦  «        }t          dt          |¦  «        ¦  «        D ]}t          ||         |¦  «        ||<   Œd 	                    |¦  «        S )aë  Decode what you can for a URL, so that we get a nice looking path.

    This will turn file:// urls into local paths, and try to decode
    any portions of a http:// style url that it can.

    Any sections of the URL which can't be represented in the encoding or
    need to stay as escapes are left alone.

    Args:
      url: A 7-bit ASCII URL
      encoding: The final output encoding

    Returns: A unicode string which can be safely encoded into the
         specified encoding.
    Nz0you cannot specify None for the display encodingr_   r?   r   )
r9   rZ   r;   r’   rÜ   r&   r�   r7   rþ   rT   )r(   rù   r5   Úresr•   s        r   Úunescape_for_displayr  É  sÕ   € ð  ÐÝÐKÑLÔLÐLØ
‡~‚~�iÑ Ô ð ð	Ý& sÑ+Ô+ˆDØ�KŠK˜Ñ!Ô!Ð!ØˆKøÝð 	ð 	ð 	ØˆJˆJˆJð	øøøð �)Š)�C‰.Œ.€CÝ�1•c˜#‘h”hÑÔð Að AˆÝ.¨s°1¬v°xÑ@Ô@ˆˆA‰ˆØ�8Š8�C‰=Œ=Ðs   ¨%A ÁAÁAc                 óP  — t          | ¦  «        } |                      d¦  «        dk    s#|                      t          j        ¦  «        dk    r2t          j                             |                      d¦  «        ¦  «        S |                      d¦  «        }|dk    r| |dz   d…         S | S )aþ  Derive a TO_LOCATION given a FROM_LOCATION.

    The normal case is a FROM_LOCATION of http://foo/bar => bar.
    The Right Thing for some logical destinations may differ though
    because no / may be present at all. In that case, the result is
    the full name without the scheme indicator, e.g. lp:foo-bar => foo-bar.
    This latter case also applies when a Windows drive
    is used without a path, e.g. c:foo-bar => foo-bar.
    If no /, path separator or : is found, the from_location is returned.
    r?   r   z/\rp   r   N)r`   rD   ÚosÚsepr5   r)   Úrstrip)Úfrom_locationr  s     r   Úderive_to_locationr  ê  s�   € õ -¨]Ñ;Ô;€MØ×Ò˜#ÑÔ !Ò#Ð# }×'9Ò'9½"¼&Ñ'AÔ'AÀQÒ'FÐ'FÝŒw×Ò × 4Ò 4°UÑ ;Ô ;Ñ<Ô<Ð<à× Ò  Ñ%Ô%ˆØ�Š7ˆ7Ø   q¡  Ô*Ð*à Ð r   c                 ó4   — t          j        d| ¦  «        | k    S )Nz/foo)r   ÚpathjoinrJ   s    r   Ú_is_absoluter
     s   € ÝÔ˜V SÑ)Ô)¨SÒ0Ð1r   c                 ó@  — t          | ¦  «        \  }}|�| S t          | ¦  «        r| S t          j        |¦  «        }t          j        |¦  «        }|dd…         |dd…         k    rt          ||¦  «        ‚t	          |d         t          |d         | ¦  «        ¦  «        S )z¦Convert a relative path from an old base URL to a new base URL.

    The result will be a relative path.
    Absolute paths and full URLs are returned unaltered.
    Nrj   )rH   r
  rÞ   r   Údetermine_relative_pathrT   )r(   Úold_baseÚnew_baser>   Ú	separatorÚ
old_parsedÚ
new_parseds          r   Ú
rebase_urlr    sª   € õ 3°3Ñ7Ô7Ñ€FˆIØÐØˆ
Ý�CÑÔð Øˆ
ÝÔ" 8Ñ,Ô,€JÝÔ" 8Ñ,Ô,€JØ�2�A�2Œ˜J r¨ rœNÒ+Ð+Ý ¨(Ñ3Ô3Ð3Ý" :¨a¤=Ý#'¨
°1¬°sÑ#;Ô#;ñ=ô =ð =r   c                 óV  — t          j        | ¦  «        }t          j        |¦  «        }d}t          t          ||¦  «        ¦  «        D ]\  }\  }}||k    r nŒ|dz  }||d…         }||d…         }dgt	          |¦  «        z  |z   }	t	          |	¦  «        dk    rdS t          j        |	Ž S )z4Determine a relative path from from_path to to_path.r@   r   NrX   r   rW   )r   Ú	splitpathÚ	enumerater�   r7   r	  )
Ú	from_pathÚto_pathÚfrom_segmentsÚto_segmentsÚcountÚfrom_elementÚ
to_elementÚunique_fromÚ	unique_toÚsegmentss
             r   r  r    sØ   € åÔ% iÑ0Ô0€MÝÔ# GÑ,Ô,€KØ€EÝ-6µs¸=Ø;Fñ8Hô 8Hñ .Iô .Ið ð Ñ)ˆÑ)�˜jà˜:Ò%Ð%ØˆEð &ð 	�‰
ˆØ   Ô'€KØ˜E˜F˜FÔ#€IØ��˜[Ñ)Ô)Ñ)¨IÑ5€HÝ
ˆ8�}„}˜ÒÐØˆsÝÔ˜XÐ&Ð&r   c                   ól   — e Zd ZdZd„ Zd„ Zd„ Zed„ ¦   «         Zd„ Z	e
deded	efd
„¦   «         Zdd„ZdS )ÚURLzParsed URL.c                 óš  — || _         || _        t          | j        ¦  «        | _        || _        | j        �t          | j        ¦  «        | _        nd | _        || _        | j        �t          | j        ¦  «        | _        nd | _        || _        t           
                    t          |¦  «        | _        t          | j        ¦  «        | _        d S r   )r>   Úquoted_hostrß   ÚhostÚquoted_userÚuserÚquoted_passwordÚpasswordÚportr�   rŽ   r‚   Úquoted_pathr5   )r   r>   r%  r'  r#  r)  r*  s          r   r   zURL.__init__-  sµ   € àˆŒØ&ˆÔÝ˜DÔ,Ñ-Ô-ˆŒ	Ø&ˆÔØÔÐ'Ý Ô 0Ñ1Ô1ˆDŒIˆIàˆDŒIØ.ˆÔØÔÐ+Ý# DÔ$8Ñ9Ô9ˆDŒMˆMà ˆDŒMØˆŒ	Ý.×2Ò2Ý  +ñ/ô /ˆÔå˜DÔ,Ñ-Ô-ˆŒ	ˆ	ˆ	r   c                 óÌ   — t          || j        ¦  «        oO| j        |j        k    o?| j        |j        k    o/| j        |j        k    o| j        |j        k    o| j        |j        k    S r   )r‹   Ú	__class__r>   r$  r&  r(  r5   )r   rŸ   s     r   Ú__eq__z
URL.__eq__A  sq   € Ý˜5 $¤.Ñ1Ô1ð (Ø”˜uœ|Ò+ð(à”	˜UœZÒ'ð(ð ”	˜UœZÒ'ð(ð ” ¤Ò/ð	(ð
 ”	˜UœZÒ'ð	)r   c           	      óˆ   — d                      | j        j        | j        | j        | j        | j        | j        | j        ¦  «        S )Nz(<{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r})>)	rÝ   r,  r   r>   r%  r'  r#  r)  r*  )r   s    r   Ú__repr__zURL.__repr__I  s@   € Ø9×@Ò@ØŒNÔ#ØŒK˜Ô)¨4Ô+?ØÔ˜dœi¨Ô)9ñ;ô ;ð 	;r   c                 óê  — t          |t          ¦  «        rnWt          |t          ¦  «        r3	 |                     ¦   «         }n,# t          $ r t	          |¦  «        ‚w xY wt	          |¦  «        ‚t          j        |d¬¦  «        \  }}}}}}dx}x}	x}
}d|v r7|                     dd¦  «        \  }}
d|v r|                     dd¦  «        \  }}	n|}
d|
v ri|
d         dk    r|
d	         d
k    sQ|
                     dd¦  «        \  }
}|r4	 t          |¦  «        }n%# t          $ r t	          d|›d|›�¦  «        ‚w xY wd}|
dk    r"|
d         dk    r|
d	         d
k    r
|
dd	…         }
 | |||	|
||¦  «        S )z[Create a URL object from a string.

        Args:
          url: URL as bytestring
        F)Úallow_fragmentsNú@r   rp   r   ú[r@   ú]zinvalid port number z	 in url:
rV   )
r‹   rv   r’   r÷   r
   rÞ   Úrsplitr&   r}   r9   )Úclsr(   r>   Únetlocr5   ÚparamsÚqueryÚfragmentr&  r(  r$  r)  s               r   Úfrom_stringzURL.from_stringO  sÓ  € õ �c�3ÑÔð 	"ØÝ˜�SÑ!Ô!ð 	"ð&Ø—j’j‘l”l��øÝ%ð &ð &ð &Ý  ‘o”oÐ%ð&øøøõ ˜S‘/”/Ð!å$Ô-¨cÀ5ÐIÑIÔIñ	ˆ�˜˜vØ	�Ø(,Ð,ˆÐ,ˆxÐ,˜$ Ø�&ˆ=ˆ=ØŸš s¨AÑ.Ô.‰JˆD�$Ø�dˆ{ˆ{Ø!%§¢¨C°Ñ!3Ô!3‘��høàˆDà�$ˆ;ˆ;  Q¤¨3¢ °4¸´8¸s²?°?àŸš S¨!Ñ,Ô,‰JˆD�$Øð ð2Ý˜t™9œ9�D�DøÝ!ð 2ð 2ð 2Ý$˜*Ø&* d d¨C¨Cð&1ñ 2ô 2ð 2ð2øøøð �Ø�2Š:ˆ:˜$˜qœ' Sš.˜.¨T°"¬X¸ª_¨_Ø˜˜"˜”:ˆDàˆs�6˜4 ¨4°°tÑ<Ô<Ð<s   ­A ÁAÄD Ä D8c                 óÔ   — | j         }d|v rd|z  }| j        �d                     | j        |¦  «        }| j        �d|| j        fz  }t	          j        | j        || j        d d d f¦  «        S )Nrp   z[%s]z{}@{}z%s:%d)r#  r%  rÝ   r)  rÞ   Ú
urlunparser>   r*  )r   r7  s     r   Ú__str__zURL.__str__|  sƒ   € ØÔ!ˆØ�&ˆ=ˆ=Ø˜f‘_ˆFØÔÐ'ð —^’^ DÔ$4°fÑ=Ô=ˆFØŒ9Ð Ø ¨¬	Ð2Ñ2ˆFÝÔ"ØŒ[˜& $Ô"2°D¸$ÀÐEñGô Gð 	Gr   r§   r/   r+   c                 ój  — t          |t          ¦  «        st          |¦  «        ‚t                               t
          |¦  «        }|                     d¦  «        rg }n|                      d¦  «        }t          |¦  «        dk    r|d         dk    r
|dd…         }|                     d¦  «        D ]S}|dk    r)t          |¦  «        dk    rŒ| 	                    ¦   «          Œ1|dk    rŒ8|dk    r| 
                    |¦  «         ŒTd                     |¦  «        }|                     d¦  «        sd|z   }|S )ap  Transform a Transport-relative path to a remote absolute path.

        This does not handle substitution of ~ but does handle '..' and '.'
        components.

        Examples::

            t._combine_paths('/home/sarah', 'project/foo')
                => '/home/sarah/project/foo'
            t._combine_paths('/home/sarah', '../../etc')
                => '/etc'
            t._combine_paths('/home/sarah', '/etc')
                => '/etc'

        Args:
          base_path: base path
          relpath: relative url string for relative part of remote path.
        Returns: urlencoded string for final path.
        r?   r   r@   rV   NrX   rW   )r‹   rv   r
   r�   rŽ   r‚   rZ   r&   r7   rY   r[   rT   )r§   r/   Ú
base_partsÚpr5   s        r   Ú_combine_pathszURL._combine_pathsŠ  s>  € õ* ˜'¥3Ñ'Ô'ð 	&Ý˜WÑ%Ô%Ð%Ý%×)Ò)Õ*>ÀÑHÔHˆØ×Ò˜cÑ"Ô"ð 	.ØˆJˆJà"Ÿš¨Ñ-Ô-ˆJÝˆz‰?Œ?˜QÒÐ :¨b¤>°RÒ#7Ð#7Ø# C R CœˆJØ—’˜sÑ#Ô#ð 
	%ð 
	%ˆAØ�DŠyˆyÝ�z‘?”? aÒ'Ð'ð Ø—’Ñ Ô Ð Ð Ø�c’�ØØ�b’�Ø×!Ò! !Ñ$Ô$Ð$øØ�xŠx˜
Ñ#Ô#ˆØ�Š˜sÑ#Ô#ð 	Ø˜‘:ˆDØˆr   Nc                 óò   — |�<t          |¦  «        }|                      | j        |¦  «        }t          |d¬¦  «        }n| j        }|                      | j        | j        | j        | j	        | j
        |¦  «        S )zŸReturn a new URL for a path relative to this URL.

        Args:
          offset: A relative path, already urlencoded
        Returns: `URL` instance
        Nr.   r2   )ra   rB  r5   r3   r*  r,  r>   r%  r'  r#  r)  )r   ÚoffsetÚrelativer5   s       r   Úclonez	URL.clone¸  s{   € ð ÐÝ Ñ'Ô'ˆHØ×&Ò& t¤y°(Ñ;Ô;ˆDÝ˜ DÐ)Ñ)Ô)ˆDˆDàÔ#ˆDØ�~Š~˜dœk¨4Ô+;Ø"Ô2°DÔ4DÀdÄiØ"ñ$ô $ð 	$r   r   )r   r   r   Ú__doc__r   r-  r/  Úclassmethodr;  r>  Ústaticmethodrv   rB  rF  r   r   r   r!  r!  *  s¿   € € € € € ØÐð.ð .ð .ð()ð )ð )ð;ð ;ð ;ð ð*=ð *=ñ „[ð*=ðXGð Gð Gð ð+ #ð +°ð +¸ð +ð +ð +ñ „\ð+ðZ$ð $ð $ð $ð $ð $r   r!  c                 ó‚   — t                                | ¦  «        }|j        |j        |j        |j        |j        |j        fS )a'  Extract the server address, the credentials and the path from the url.

    user, password, host and path should be quoted if they contain reserved
    chars.

    Args:
      url: an quoted url
    Returns: (scheme, user, password, host, port, path) tuple, all fields
        are unquoted.
    )r!  r;  r>   r&  r(  r$  r)  r5   )r(   Ú
parsed_urls     r   Ú	parse_urlrL  Ê  s;   € õ —’ Ñ%Ô%€JØÔ˜zœ°
Ô0CØŒO˜Zœ_¨j¬oð?ð ?r   )T)r.   )MrG  r  Úrerš   Útypingr   r   Úurllibr   rÞ   rV   r   r   re   r   r
   r   r   r)   rv   Úboolr-   Úquote_from_bytesr3   Úunquote_to_bytesrß   rê   r4   r<   rH   rK   rT   rM   rc   rg   rs   rx   rŠ   r;   r7   r8   r×   r›   ÚcompilerA   r�   r‚   r–   r¯   r²   r&   r¿   rÉ   r`   rÌ   rÕ   rØ   r»   ra   Ú_no_decode_charsÚ_no_decode_ordsÚ_no_decode_hexÚdictr�   ró   rÐ   Úsetr~   rŒ   rþ   r  r  r
  r  r  r!  rL  r   r   r   ú<module>rY     s}  ðð" <Ð ;à 	€	€	€	Ø 	€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ð Ð à $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð
 Ð Ð Ð ðDð Dð Dð Dð D�Ô!ñ Dô Dð Dð
6ð 6ð 6ð 6ð 6�VÔ%ñ 6ô 6ð 6ð;ð ;ð ;ð ;ð ;˜Ô(ñ ;ô ;ð ;ðHð Hð Hð HðHð H�ð H¨dð H¸cð Hð Hð Hð Hð Ô,Ð ØŒ€ØÔ,Ð Ø
Ô
€ð%ð %�E˜% ˜*Ô%ð %¨Sð %¸Cð %ð %ð %ð %ð
/�sð / #ð /¨#ð /ð /ð /ð /ð;ð ;ð ;ð*1ð 1ð 1ð
!$ˆsð !$˜cð !$ð !$ð !$ð !$ðHð ð ðDð ð ð7ð 7ð 7ð@ð @ð @ð>$ð $ð $ð, -Ð Ø0Ð Ø˜˜Z™œÐ Ø"˜s =Ñ1Ô1Ð à„<�7ÒÐØ0ÐØ4Ðà9Ðð �”ÐGÑHÔH€Ø �b”jÐ!4Ñ5Ô5Ð ð
)ð 
)ð 
)ð*ð *ð *ðZ1,ð 1,ð 1,ðh	ð 	ð 	ð&!ð &!ˆsð &!¨Dð &!¸EÀ#ÀsÀ(¼Oð &!ð &!ð &!ð &!ðRCð Cð Cð&"ð "ð "ð,ð ð ð+ð +ð +ð&Lð Lð Lð6ð ð ð&ð &ð &ðR!ð !ð !ð. !Ð Ø4Ð4Ð#3Ð4Ñ4Ô4€Ø7Ð7 Ð7Ñ7Ô7Ø9Ð9¨Ð9Ñ9Ô9ñ:€à�4ÐFÐF¸5¸5À¹:¼:ÐFÑFÔFØIÐI¸e¸eÀC¹j¼jÐIÑIÔIñJñ Kô KÐ ð × Ò ð 3ð 3Ø#1ð3ñ 3ô 3ñ 3ô 3ð 3ð
 "˜cðñô Ð ð �sð	ñô Ð ð(ð (ð (ðVð ð ðB!ð !ð !ð,2ð 2ð 2ð=ð =ð =ð&'ð 'ð 'ð&]$ð ]$ð ]$ð ]$ð ]$ñ ]$ô ]$ð ]$ð@?ð ?ð ?ð ?ð ?r   