文件操作 - _uri.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/lazr/uri/__pycache__/_uri.cpython-310.pyc
编辑文件内容
o �^K � @ s* d Z eZg d�ZddlZze W n ey eZY nw i dd�dd�dd �d d�dd �dd�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�i d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d2�d4d5�d6d7�d8d9�d:d;�d<d=�d>d=�d?d@�dAd@�dBdC��d@ddDdEdDdDdFdDdG��ZdHZ dIZ dJZdKZdLe eef Z dMZdNZdOZdPe ZdQZdRe eeeef ZdSe eeeef ZdTZdUZdVe eeef ZdWeeef Ze�eej�Ze�eej�ZdXdY� ZdZd[� Zd\d]� ZG d^d_� d_e �Z!G d`da� da�Z"dbdcddi Z#e�e#ejej$B �Z%e�de�Z&dfdg� Z'dS )hz/Functions for working with generic syntax URIs.)�URI�InvalidURIError�find_uris_in_text�possible_uri_re�merge�remove_dot_segments� N�acap�674�dav�80�dict�2628�dns�53�ftp�21�go�1096�gopher�70�h323�1720�http�https�443�imap�143�ipp�631z iris.beep�702�ldap�389�mtqp�1038�mupdate�3905�nfs�2049�nntp�119�pop�110�rtsp�554�sip�5060�sips�5061�snmp�161z soap.beep�605z soap.beeps�telnet�23�tftp�69�tip�3372�vemmi�575zxmlrpc.beep�602zxmlrpc.beepszz39.50r�210zz39.50s�prospero�1525�22�6667�3690)�wais�bzr+http�bzr+ssh�irc�sftp�ssh�svn�svn+sshz(?P<scheme>[a-z][-a-z0-9+.]*)z9(?P<userinfo>(?:[-a-z0-9._~!$&\'()*+,;=:]|%[0-9a-f]{2})*)zs(?P<host>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|(?:[-a-z0-9._~!$&\'()*+,;=]|%[0-9a-f]{2})*|\[[0-9a-z:.]+\])z(?P<port>[0-9]*)z!(?P<authority>(?:%s@)?%s(?::%s)?)z2(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z](?:[-a-z0-9._~!$&\'()*+,;=@]|%[0-9a-f]{2})+(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z^(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})+(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z/(?:%s)?� z(?P<hierpart>//%s%s|%s|%s|%s)z!(?P<relativepart>//%s%s|%s|%s|%s)z=(?P<query>(?:[-a-z0-9._~!$&\'()*+,;=:@/?\[\]]|%[0-9a-f]{2})*)z<(?P<fragment>(?:[-a-z0-9._~!$&\'()*+,;=:@/?]|%[0-9a-f]{2})*)z%s:%s(?:\?%s)?(?:#%s)?$z%s(?:\?%s)?(?:#%s)?$c C s2 |r | dkr d| S | � d�}| d|d � | S )a/ Merge two URI path components into a single path component. Follows rules specified in Section 5.2.3 of RFC 3986. The algorithm in the RFC treats the empty basepath edge case differently for URIs with and without an authority section, which is why the third argument is necessary. rL �/N� )�rfind)�basepath�relpath� has_authority�slash� rT �//usr/lib/python3/dist-packages/lazr/uri/_uri.pyr � s r c C s� g }| rz| � d�r| dd� } nh| � d�r| dd� } n\| � d�s%| dkr.d| dd� } nJ| � d �s7| d krId| dd� } t|�dkrH|d = n/| dv rPd} n(| � d�r\| �dd�}n| �d�}|dk rit| �}|�| d|� � | |d� } | sd�|�S )zqRemove '.' and '..' segments from a URI path. Follows the rules specified in Section 5.2.4 of RFC 3986. z../� Nz./� z/./z/.rM z/../z/..� r ���)�.z..rL rN )� startswith�len�find�append�join)�path�outputrS rT rT rU r � s0 � � r c C s� | � d�}d}t|�D ]=\}}|dkrqzt|dd� d�}W n ty( Y qw t|�|v r<t|�|dd� ||<