403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/breezy/__pycache__/urlutils.cpython-313.pyc
�

p��g��
�"�SrSSKrSSKrSSKrSSKrSSKJr SSKJr	 SSK
JrJr "SS\R5r"S	S
\R5r"SS\R5rSBS
jrSBS\S\S\4Sjjr\	R*r\	R,r\	R.r\	R0rSCS\\\4S\S\4SjjrS\S\S\4SjrSrSrS\S\4SjrSrSr Sr!Sr"Sr#\!r$\ r%\&"S 5r'\&"S!5r(\RRS":Xa\#r$\"r%\(r'\RT"S#5r+\RT"S$5r,S%r-S&r.S'r/S(r0SBS\S\S\1\\44S)jjr2S*r3S+r4S,r5S-r6S.r7S/r8S0r9S1r:S2r;\;Vs/sHn\<"U5PM
 snr=\=Vs/sHnS3R}U5PM sn\=Vs/sHnS4R}U5PM sn-r?\@"\A"S55Vs/sHnS3R}U5\"U/54PM sn\A"S55Vs/sHnS4R}U5\"U/54PM sn-5rB\BR�S6\?55 \D"S75rE\D"S85rFS9rGS:rHS;rIS<rJS=rKS>rL"S?S@5rMSArNgs snfs snfs snfs snfs snf)Dz5A collection of function for handling URL operations.�N)�Union)�parse�)�errors�osutilsc��\rSrSrSrSrg)�
InvalidURL�z6Invalid url supplied to transport: "%(path)s"%(extra)s�N)�__name__�
__module__�__qualname__�__firstlineno__�_fmt�__static_attributes__r��1/usr/lib/python3/dist-packages/breezy/urlutils.pyr	r	s��C�Drr	c��\rSrSrSrSrSrg)�InvalidURLJoin�!z>Invalid URL join request: %(reason)s: %(base)r + %(join_args)rc�h�XlX lX0l[RRXU5 g�N)�reason�base�	join_argsr�	PathError�__init__)�selfrrrs    rr�InvalidURLJoin.__init__$s'�����	�"�����!�!�$�f�5r)rrrN�rr
rrrrrrrrrr!s��K�D�6rrc��\rSrSrSrSrSrg)�InvalidRebaseURLs�+z3URLs differ by more than path: %(from_)r and %(to)rc�\�XlX l[RR	XS5 g)NzURLs differ by more than path.)�from_�torrr)rr%r&s   rr�InvalidRebaseURLs.__init__.s#���
������!�!�$�/O�Pr)r%r&Nr rrrr"r"+s
��@�D�Qrr"c��[XS9S$)aRReturn 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/4�����D�Q�G�Grr.r*�returnc��[XS9S$)aReturn 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)rr+r-s  r�dirnamer3Cr0r�relpath�safec��[XS9$)z!Escape relpath to be a valid url.�r5)�quote)r4r5s  r�escaper9Xs
����$�$rr�pathc�
�[U5[:a[SU[4-5e[R"[U55n[R"[U55n[
[R"X55$)zxCompute 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_urlr9r4)rr:s  r�file_relpathrA]st��
�4�y�)�)��
D��+�,�
-�
�	
�
���/��5�6�D����/��5�6�D��'�/�/�$�-�.�.rc��[RU5nU(dgURS5nURS5nURS5nUS:Xa
[	U5S4$[	U5XARS5-4$)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�schemer:�/���N)�_url_scheme_re�match�group�findr<�start)r.�mrCr:�first_path_slashs     r�_find_scheme_and_separatorrMmsw��	���S�!�A���
�W�W�X�
�F��7�7�6�?�D��y�y��~���2���6�{�D� � ��v�;�(�7�7�6�?�:�:�:rc�0�[RU5SL$)z,Tests whether a URL is in actual fact a URL.N)rFrG�r.s r�is_urlrP�s������$�D�0�0rc��U(dU$[U5up#UcUcSnOUc[U5nXSnUHAn[U5upgUcUcSnOUc[U5nUbUnXWSnUnUnM6[XE5nMC USUU-$)avCreate 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)rMr<�joinpath)r�args�
scheme_end�
path_startr:�arg�arg_scheme_end�arg_path_starts        r�joinrY�s������7��=��J���j�0��
�	�	���Y�
����D���)C�C�)H�&���!�n�&<��N�
�
#� ��X�N��%��D���'�D�'�J�'�J��D�&�D������t�#�#rc��URS5n[U5S:�aUSS:XaUR5 UHwnURS5(a/nURS5HGnUS:XaMUS:Xa%US/:Xa[	SX5eUR5 M6URU5 MI My US/:XagSR
U5$)aoJoin 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.
rDrrE��.�..zCannot go above root)r,r<�pop�
startswithr�appendrY)rrSr:rV�chunks     rrRrR�s����:�:�c�?�D�
�4�y�1�}��b��R�����
����>�>�#����D��Y�Y�s�^�E���|���$���B�4�<�(�)?��L�L����
����E�"�$����t�|���x�x��~�rc���[U5nSnURU5(aU[U5S-
SnO0URS5(d[US5eU[S5Sn[	U5$)z9Convert a url like file:///path/to/foo into /path/to/foo.zfile://localhost/rN�file:///z8local urls must start with file:/// or file://localhost/�file://)�strip_segment_parametersr_r<r	�unescape)r.�file_localhost_prefixr:s   r�_posix_local_path_from_urlrh�sy��
"�3�
'�C�/��
�~�~�+�,�,��3�,�-��1�3�4��
�^�^�J�
'�
'���K�
�	
��3�y�>�#�$���D�>�rc�F�S[[R"U55-$)z�Convert a local path like ./foo into a URL like file:///path/to/foo.

This also handles transforming escaping unicode characters, etc.
rd)r9�	posixpath�abspath)r:s r�_posix_local_path_to_urlrl�s���v�i�/�/��5�6�6�6rc��URS5(d[US5e[U5nU[S5SnURS5(d)USS:Xd	USS	;a[US
5e[	U5$US:Xag[U5S:dUSS;dUS
S	;d	USS:wa[US5eUSR5S-[	USS5-$)z>Convert a url like file:///C:/path/to/foo into C:/path/to/foo.rdzJlocal urls must start with file:///, UNC path urls must start with file://�file:Nz///�rD�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�:)r_r	rer<rf�upper)r.�	win32_urls  r�_win32_local_path_from_urlrx�s���>�>�)�$�$���
4�
�	
�
#�3�
'�C��C��L�N�#�I�����&�&��Q�<�3��)�A�,�$�"6��S�"R�S�S��	�"�"��E���	�I�����Q�<� V�W��Q�<�t�#��Q�<�3����U�
�	
��Q�<����#�%���1�2��(?�?�?rc���US:Xag[R"U5nURS5(aS[U5-$S[	USR55-S-[USS5-$)	z�Convert a local path like ./foo into a URL like file:///C:/path/to/foo.

This also handles transforming escaping unicode characters, etc.
rDrcz//rnrruroN)r�_win32_abspathr_r9�strrv)r:�
win32_paths  r�_win32_local_path_to_urlr}
sq���s�{���'�'��-�J����T�"�"���
�+�+�+���J�q�M�/�/�1�2�2�S�8�6�*�Q�R�.�;Q�Q�Qrrczfile:///C:/�win32z)^(?P<scheme>[^:/]{2,}):(//)?(?P<path>.*)$z(%[0-9a-fA-F]{2})c��URS5SSn[[US55nU[;aU$URS5R	5$)zlre.sub callback to convert hex-escapes to plain characters (if safe).

e.g. '%7E' will be converted to '~'.
rrN�)rH�chr�int�_url_dont_escape_charactersrv)�matchobj�
hex_digits�chars   r�_unescape_safe_charsr�/sP��
����"�1�2�&�J��s�:�r�"�#�D��*�*����~�~�a� �&�&�(�(rc	��[U5upUc[U5$USUnXSn[U[5(deUH(nU[;dM[USR
U55e [R[U5n[USRU5-5$[U5n[[U55H^nXg[;dMSR[XgRS55Vs/sHnSR
U5PM sn5Xg'M` SRU5n[R[U5n[X4-5$s snf)aMake 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.
Nz9URLs can only contain specific safe characters (not {!r})r[�utf-8z%{:02X})rM�local_path_to_url�
isinstancer{�_url_safe_charactersr	�format�_url_hex_escapes_re�subr�rY�list�ranger<�	bytearray�encode)r.rTrU�prefixr:�c�
path_chars�is        r�
normalize_urlr�<sF��(8��<��J��� ��%�%�
��*�
�F��{��D��c�3����A��,�,� ��O�V�V������#�&�&�';�T�B���6�B�G�G�D�M�)�*�*��d��J�
�3�z�?�
#���=� 4�4��G�G�.7�
�
�8L�8L�W�8U�.V�W�.V���!�!�!�$�.V�W��J�M�$�
�7�7�:��D��"�"�#7��>�D��v�}����	Xs�8E
c��[U5up#UcU$[U5up$UcU$USUnUSUnXV:waU$[RS:Xa!US:XaXS-US-nXS-US-nXx:waU$XS-Sn	XS-Sn
U	RS5(aU	SSn	U	R	S5nU
R	S5nUS/:Xa/nUS/:Xa/n/n
[X�5Hup�X�:wa OU
R
U5 M [U
5nUUSVs/sHnS	PM n
nU
RUUS5 SRU
5=(d S
$s snf)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.
Nr~rdrrprDrEr[r]r\)
rM�sys�platform�endswithr,�zipr`r<�extendrY)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_len�xs                  r�relative_urlr�ns���9��>��E�����9�%�@��E�� ����(�(�)�K��+�+�,�L��"���	����	 �[�I�%=��Q�.�1A�A�1E�F�
���1�4E��4I�J���$��L���)�+�,�I��1�,�.�/�J����#����c�r�N�	��O�O�C�(�M��%�%�c�*�N������
��"������O��M�2����6�����q�!�3�
�O�$�I�%2�9�:�%>�?�%>��t�%>�O�?����>�)�*�5�6��8�8�O�$�+��+��@s�Ec�~�[U5S:dUSS;d	USS:wa[X-S5eXSS-
nUSSnX4$)	z<On win32 the drive letter needs to be added to the url base.rsroz:|rprDz(win32 file:/// paths need a drive letterrN)r<r	)�url_baser:s  r�_win32_extract_drive_letterr��sU���4�y�1�}��Q��t�+�t�A�w�#�~����*T�U�U��Q�q�	��H����8�D��>�rc��[U5up#Uc?Uc8U(aURS5(aUSSn[R"U5$US4$USUnXSn[R
S:Xa#UR
S5(a
[XE5upEU(a*[U5S:�aURS5(aUSSn[R"U5upgXF-U4$)aJSplit 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.
NrDrEr[r~rcr)	rMr�rjr,r�r�r_r�r<)r.r*�
scheme_locrLr�r:�head�tails        rr,r,�s���$>�c�#B� �J�����%�#�,�,�s�*;�*;��#�2�h���?�?�3�'�'���7�N��$�$�%�H�� �!�D�
�|�|�w��3�>�>�*�#=�#=�5�X�D����#�d�)�a�-�D�M�M�#�4F�4F��C�R�y������&�J�D��?�D� � rc���[U5nURSURS5S-5nUS:XaU/4$USUXS-SRS5Vs/sHn[	U5PM sn4$s snf)zxSplit the subsegment of the last segment of a URL.

Args:
  url: A relative or absolute URL
Returns: (url, subsegments)
�,rDrrEN)�strip_trailing_slashrI�rfindr,r{)r.�lurl�
segment_start�ss    r�split_segment_parameters_rawr��s��� ��$�D��I�I�c�4�:�:�c�?�Q�#6�7�M�����R�y���^�m���a�/�1�2�8�8��=�>�=�A��Q��=�>����>s�A/c��[U5up0nUH\nURSS5upV[	U[
5(d[
U5e[	U[
5(d[
U5eXcU'M^ X4$![a
 [US5ef=f)z�Split the segment parameters of the last segment of a URL.

Args:
  url: A relative or absolute URL
Returns: (url, segment_parameters)
�=rzmissing = in subsegment)r�r,r>r	r�r{�	TypeError)r.�base_url�subsegments�
parameters�
subsegment�key�values       r�split_segment_parametersr��s���;�3�?��X��J�!�
�	=�%�+�+�C��3�L�S��#�s�#�#��C�.� ��%��%�%��E�"�"��3��"�
�!�!���	=��S�";�<�<�	=�s�A5�5Bc� �[U5upU$)z_Strip the segment parameters from a URL.

Args:
  url: A relative or absolute URL
Returns: url
)r�)r.r�r�s   rreres��9��=��H��Orc���U(dU$UHDn[U[5(d[SRU55eSU;dM:[	SX5e SRU4U-5$)z�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�r{r�r�rrY)rr�r�s   r�join_segment_parameters_rawr�sh�����!�
��*�c�*�*��A�H�H��T�U�U��*�� �!:�D�N�N�	"�
�8�8�T�G�k�)�*�*rc	���[U5up#0nURU5 UR5HyupV[U[5(d[SR
U55e[U[5(d[SR
Xe55eSU;a[SX5eXdU'M{ [U/[UR55Vs/sHnSR"U6PM snQ76$s snf)a0Create 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
zparameter key {!r} is not a strz*parameter value {!r} for {!r} is not a strr�z= exists in parameter keyz{}={})
r��update�itemsr�r{r�r�rr��sorted)r.r�r�existing_parameters�new_parametersr�r��items        r�join_segment_parametersr�s���#;�3�"?��T��N����-�.� �&�&�(�
���#�s�#�#��=�D�D�S�I�J�J��%��%�%��<�C�C�E�O��
��#�:� �!<�c�N�N�#�s��)�'���28��9M�9M�9O�2P�Q�2P�$�����%�2P�Q����Qs�C/
c�6�[U5[:�aUSS$U$)z%Strip slashes after the drive letter.NrE)r<�WIN32_MIN_ABS_FILEURL_LENGTHrOs r�!_win32_strip_local_trailing_slashr�:s��
�3�x�.�.��3�B�x���
rc��URS5(dU$[RS:Xa!URS5(a[	U5$[U5upUcUSS$UbU[
U5S-
:XaU$USS$)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:/
rDr~rdNrEr)r�r�r�r_r�rMr<)r.r�rLs   rr�r�Bs���*�<�<�����
�
�|�|�w��3�>�>�)�#<�#<�0��5�5�#=�c�#B� �J����3�B�x����#3�s�3�x�!�|�#C��
��s��8�Orc���[U[5(aURS5 [R"U5$![a n[	USRU55eSnAff=f)zJUnescape relpath from url format.

This returns a Unicode path from a URL
�asciiz!URL was not a plain ASCII url: {}N)r�r{r��UnicodeErrorr	r��urlparse�unquote)r.�es  rrfrfksc���#�s���	Q��J�J�w�����C� � ���	Q��S�"E�"L�"L�Q�"O�P�P��	Q�s�>�
A(�A#�#A(z;/?:@&=+$,#z{:02x}z{:02X}�c#�L# �UHoSURS5-4v� M g7f)�%r�N)r�)�.0�hexs  r�	<genexpr>r��s!���T�^�c�d�S�Z�Z��%8�8�9�^�s�"$zBabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~zSabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-!~*'()/;?:@&=+$,%#c	�\�URS5nUSRS5US'[S[U55H4nX#n[USSX#'X#==USSRS5-
ss'M6 S	RU5nURS5nURU5 U$![
a SUSSRS5-X#'N~[a, [[USSS55RS5X#'N�f=f![a Us$f=f![a Us$f=f)
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.
�%rr�rNror�r�r)r,r�r�r<�_hex_display_map�KeyError�UnicodeDecodeErrorr�r�rY�decode�UnicodeEncodeError)�segment�encoding�escaped_chunks�jr��	unescaped�decodeds       r�_unescape_segment_for_displayr��sJ���]�]�3�'�N�&�q�)�0�0��9�N�1��
�1�c�.�)�
*��� ��	G� 0��b�q�� :�N��	��T�!�"�X�_�_�W�5�5��+�����(�I���"�"�7�+��	��N�N�8�$��N��-�	B� $��R�a�����(@� A�N��!�	G� #�C��R�a��"�$5� 6� =� =�g� F�N��	G��"�	��N�	�������s<�B-�D�D
�-#D�2D�D�
D�D�D+�*D+c�H�Uc[S5eURS5(a[U5nURU5 U$URS5n[
S[U55Hn[X4U5X4'M SRU5$![a Us$f=f)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.
z0you cannot specify None for the display encodingrdrDr)
r>r_r@r�r�r,r�r<r�rY)r.r�r:�resr�s     r�unescape_for_displayr��s��� ���K�L�L�
�~�~�i� � �	�&�s�+�D��K�K��!��K�
�)�)�C�.�C�
�1�c�#�h�
��.�s�v�x�@��� ��8�8�C�=����	��J�	�s�B�B!� B!c�$�[U5nURS5S:�d#UR[R5S:�a.[RRUR
S55$URS5nUS:�aXS-S$U$)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.
rDrz/\rurN)rerI�os�sepr:r/�rstrip)�
from_locationr�s  r�derive_to_locationr��s���-�]�;�M����#��!�#�}�'9�'9�"�&�&�'A�Q�'F��w�w���
� 4� 4�U� ;�<�<�� � ��%����7� �q���+�+� � rc�6�[R"SU5U:H$)Nz/foo)r�pathjoinrOs r�_is_absoluter�s�����F�C�(�C�/�/rc��[U5up4UbU$[U5(aU$[R"U5n[R"U5nUSSUSS:wa[X5e[	US[USU55$)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.
Nro)rMr�r�r"�determine_relative_pathrY)r.�old_base�new_baserC�	separator�
old_parsed�
new_parseds       r�
rebase_urlrs���3�3�7��F�
���
��C����
��"�"�8�,�J��"�"�8�,�J��2�A��J�r��N�+���3�3�"�:�a�=�$�z�!�}�c�2J�K�Krc�0�[R"U5n[R"U5nSn[[X#55HunupVXV:wdM O US-
nX$SnX4SnS/[	U5-U-n	[	U	5S:Xag[R
"U	6$)z4Determine a relative path from from_path to to_path.rErNr]rr\)r�	splitpath�	enumerater�r<r�)
�	from_path�to_path�
from_segments�to_segments�count�from_element�
to_element�unique_from�	unique_to�segmentss
          rrrs����%�%�i�0�M��#�#�G�,�K��E�-6�s�=�7V�-W�)��)���%��.X�	��
����'�K��F�#�I��v��K�(�(�9�4�H�
�8�}�������X�&�&rc�j�\rSrSrSrSrSrSr\S5r	Sr
\S\S	\S
\4Sj5r
SS
jrSrg)�URLi+zParsed URL.c��XlX@l[UR5UlX lURb[UR5UlOSUlX0lURb[UR5UlOSUlXPl[R[U5Ul[UR5Ul
gr)rC�quoted_hostr��host�quoted_user�user�quoted_password�password�portr�r�r��quoted_pathr:)rrCrrrrrs       rr�URL.__init__.s�����&���D�,�,�-��	�&�����'��� 0� 0�1�D�I��D�I�.�����+�#�D�$8�$8�9�D�M� �D�M��	�.�2�2�3G��U����D�,�,�-��	rc�l�[XR5=(a� URUR:H=(ay URUR:H=(aY URUR:H=(a9 UR
UR
:H=(a URUR:H$r)r��	__class__rCrrrr:)rr�s  r�__eq__�
URL.__eq__Bs����u�n�n�-�
(����u�|�|�+�
(��	�	�U�Z�Z�'�
(��	�	�U�Z�Z�'�
(��
�
����/�	
(�
�	�	�U�Z�Z�'�
	
rc	���SRURRURURUR
URURUR5$)Nz(<{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r})>)	r�r!rrCrrrrr)rs r�__repr__�URL.__repr__LsT��9�@�@��N�N�#�#��K�K����� � �����I�I����
�	
rc��[U[5(aO2[U[5(aUR5nO[	U5e[
R
"USS9up#pEpgS=n=n	=p�SU;a/UR
SS5up�SU;aURSS5up�OUn
SU
;a<U
SS:Xa	U
S	S
:Xd*U
R
SS5up�U(a
[U5nOSnU
S:waU
SS:XaU
S	S
:XaU
SS	n
U"X(X�X�5$![a [	U5ef=f![a [	SRX�55ef=f)
zCCreate a URL object from a string.

Args:
  url: URL as bytestring
F)�allow_fragmentsN�@rrur�[rE�]z!invalid port number {} in url:
{}r[)r�r{r�r�r	r��rsplitr,r�r>r�)�clsr.rC�netlocr:�params�query�fragmentrrrrs            r�from_string�URL.from_stringWse���c�3����
��S�
!�
!�
&��j�j�l���S�/�!�:B�:K�:K���;
�7���u�)-�,��,�x�,�$��&�=����s�A�.�J�D��d�{�!%���C��!3�����D��$�;��Q��3��4��8�s�?����S�!�,�J�D����t�9�D����2�:�$�q�'�S�.�T�"�X��_���"�:�D��6���<�<��=&�
&� ��o�%�
&��*"��$�<�C�C�D�N����s�D	�D"�	D�"%Ec�2�URnSU;aSRU5nURbSRURU5nURbSXR4-n[R
"URXRSSS45$)Nruz[{}]z{}@{}z%s:%d)rr�rrr��
urlunparserCr)rr.s  r�__str__�URL.__str__�s����!�!���&�=��]�]�6�*�F����'��^�^�D�$4�$4�f�=�F��9�9� ���	�	�2�2�F��"�"�
�[�[�&�"2�"2�D�$��E�
�	
rr�r4r1c�$�[U[5(d[U5e[R	[
U5nUR
S5(a/nOURS5n[U5S:�aUSS:XaUSSnURS5HMnUS:Xa#[U5S:XaMUR5 M,US:XaM4US:wdM<URU5 MO SRU5nUR
S5(dSU-nU$)aTransform 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.
rDrrEr[Nr]r\)r�r{r	r�r�r�r_r,r<r^r`rY)r�r4�
base_parts�pr:s     r�_combine_paths�URL._combine_paths�s���*�'�3�'�'��W�%�%�%�)�)�*>��H�����c�"�"��J�"����-�J��z�?�Q��:�b�>�R�#7�#�C�R��J����s�#�A��D�y��z�?�a�'����� ��c����b���!�!�!�$�$��x�x�
�#�����s�#�#���:�D��rNc��Ub2[U5nURURU5n[USS9nOURnURURURURURURU5$)zReturn a new URL for a path relative to this URL.

Args:
  offset: A relative path, already urlencoded
Returns: `URL` instance
�/~r7)rfr;r:r8rr!rCrrrr)r�offset�relativer:s    r�clone�	URL.clone�s~������'�H��&�&�t�y�y�(�;�D���D�)�D��#�#�D��~�~��K�K����� � �����I�I��

�	
r)
rrr:rrrrrrCrr)rr
rr�__doc__rr"r%�classmethodr2r6�staticmethodr{r;rArrrrrr+s]���.�(
�	
��,=��,=�\

��+�#�+��+��+��+�Z
rrc��[RU5nURURURUR
URUR4$)aExtract 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.
)rr2rCrrrrr:)r.�
parsed_urls  r�	parse_urlrH�sJ������%�J�������������������
�r)T)r>)OrCr�rj�rer��typingr�urllibrr�r[rrrr	rr"r/r{�boolr3�quote_from_bytesr8�unquote_to_bytesr��bytesr9rArMrPrYrRrhrlrxr}r�r@r<r=r�r��compilerFr�r�r�r�r��tupler,r�r�rer�r�r�r�rf�_no_decode_chars�ord�_no_decode_ordsr��_no_decode_hex�dictr�r�r��setr�r�r�r�r�r�rrrrH)r�r�s00r�<module>rXs7��"<�	��	�
��$��D��!�!�D�6�V�%�%�6�Q��(�(�Q�H�H��H�d�H�c�H��,�,�������,�,��
�
�
��%�E�%��*�%�%�S�%�C�%�

/�s�
/�#�
/�#�
/� ;�*1�
"$�s�"$�c�"$�J�B
� 7� @�FR�*-��0���Z���"�=�1���<�<�7��0��4��9�����G�H���j�j�!4�5��
)�/�d1,�h�&!�s�&!�D�&!�E�#�s�(�O�&!�R�*"�,�+�$�8�&�R!�,!��#3�4�#3�a�3�q�6�#3�4��.=�>�o��(�/�/�!�$�o�>� /�B� /�1�H�O�O�A���B����/4�S�z�:�z�!�h�o�o�a��%���*�%�z�:�16�s��<��A������E�1�#�J�'��<�=���
���T�^�T�T�"�����	���(�V�B!�,0�L�$'�$l
�l
�^��q
5��>��B��;��<s�-I8�I=�'J�$J�$J

Youez - 2016 - github.com/yon3zu
LinuXploit