| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/fs/__pycache__/ |
Upload File : |
�
��obc4 � �F � d Z ddlmZmZ ddlZddlZddlmZ ej r
ddlm Z m
Z
mZ g d�Z ej dej � j Zd � Zd
� Zdd�Zd� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$ e%d� Z&d� Z'y) aA Useful functions for working with PyFilesystem paths.
This is broadly similar to the standard `os.path` module but works
with paths in the canonical format expected by all FS objects (that is,
separated by forward slashes and with an optional leading slash).
See :ref:`paths` for an explanation of PyFilesystem paths.
� )�print_function�unicode_literalsN� )�IllegalBackReference)�List�Text�Tuple)�abspath�basename�combine�dirname�forcedir�frombase�isabs�isbase� isdotfile�isparent� issamedir�
iswildcard�iteratepath�join�normpath�parts�recursepath�relativefrom�relpath�split�splitextz(^|/)\.\.?($|/)|//c �T � | dv r| S t | � s| j d� S | j d� rdnd}g } | j d� D ]. }|dv r|dk( s�
|j � �|j |� �0 |dj |� z S # t $ r t | � �w xY w)a Normalize a path.
This function simplifies a path by collapsing back-references
and removing duplicated separators.
Arguments:
path (str): Path to normalize.
Returns:
str: A valid FS path.
Example:
>>> normpath("/foo//bar/frob/../baz")
'/foo/bar/baz'
>>> normpath("foo/../../bar")
Traceback (most recent call last):
...
fs.errors.IllegalBackReference: path 'foo/../../bar' contains back-references outside of filesystem
�/� �..) �_requires_normalization�rstrip�
startswithr �pop�append�
IndexErrorr r )�path�prefix�
components� components �)/usr/lib/python3/dist-packages/fs/path.pyr r 2 s� � �, �s�{��� #�4�(��{�{�3����O�O�C�(�S�b�F��J� )����C�� -�I��D� ���$��N�N�$��!�!�)�,� -� �C�H�H�Z�(�(�(�� � )�"�4�(�(�)�s �B �$B �B'c �T � t t | � � } | sg S | j d� S )z�Iterate over the individual components of a path.
Arguments:
path (str): Path to iterate over.
Returns:
list: A list of path components.
Example:
>>> iteratepath('/foo/bar/baz')
['foo', 'bar', 'baz']
r )r r r �r) s r- r r ^ s( � � �8�D�>�"�D��� ��:�:�c�?�� c �� � | dv rdgS t t | � � dz } dg}| j }|j }d}t | � }||k r |d|� } || d| � |dz
}||k r�|r|ddd� S |S )aN Get intermediate paths from the root to the given path.
Arguments:
path (str): A PyFilesystem path
reverse (bool): Reverses the order of the paths
(default `False`).
Returns:
list: A list of paths.
Example:
>>> recursepath('a/b/c')
['/', '/a', '/a/b', '/a/b/c']
r r N���)r
r �findr'