| 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 : |
�
��obUk � � � d Z ddlmZ ddlZddlmZmZmZ ddlm Z ddl
mZ ddlm
Z
mZmZ ej r-dd lmZmZmZmZmZmZmZmZmZmZ dd
lmZ ddlmZ eeege f Z! ejD dd
�� Z# edd� Z$ G d� de%� Z& G d� dejN e# � Z( e&� Z)e)jT Z*e)jV Z,e)j: Z-e)j\ Z/y)z�Machinery for walking a filesystem.
*Walking* a filesystem means recursively visiting a directory and
any sub-directories. It is a fairly common requirement for copying,
searching etc. See :ref:`walking` for details.
� )�unicode_literalsN)�defaultdict�deque�
namedtuple� )� make_repr)�FSError)�abspath�combine�normpath)
�Any�Callable�
Collection�Iterator�List�MutableMapping�Optional�Text�Tuple�Type)�FS)�Info�_Fr )�bound�Stepzpath, dirs, filesc �� � � e Zd ZdZ d� fd� Zed� � Zed� � Zed� � Zed� � Z d� Z
dd�Zd � Zd
� Z
d� Zd� Zd
� Z dd�Z dd�Zdd�Zdd�Z dd�Z dd�Z dd�Z� xZS )�Walkerz>A walker object recursively lists directories in a filesystem.c �6 �� |dvrt d� �|| _ |r
|r%t d� �|r| j n| j }t |� st d� �|| _ || _ || _ || _ || _
|| _ || _ t t | �? � y)a- Create a new `Walker` instance.
Arguments:
ignore_errors (bool): If `True`, any errors reading a
directory will be ignored, otherwise exceptions will
be raised.
on_error (callable, optional): If ``ignore_errors`` is `False`,
then this callable will be invoked for a path and the
exception object. It should return `True` to ignore the error,
or `False` to re-raise it.
search (str): If ``"breadth"`` then the directory will be
walked *top down*. Set to ``"depth"`` to walk *bottom up*.
filter (list, optional): If supplied, this parameter should be
a list of filename patterns, e.g. ``["*.py"]``. Files will
only be returned if the final component matches one of the
patterns.
exclude (list, optional): If supplied, this parameter should be
a list of filename patterns, e.g. ``["~*"]``. Files matching
any of these patterns will be removed from the walk.
filter_dirs (list, optional): A list of patterns that will be used
to match directories paths. The walk will only open directories
that match at least one of these patterns.
exclude_dirs (list, optional): A list of patterns that will be
used to filter out directories from the walk. e.g.
``['*.svn', '*.git']``.
max_depth (int, optional): Maximum directory depth to walk.
)�breadth�depthz#search must be 'breadth' or 'depth'z,on_error is invalid when ignore_errors==Truezon_error must be callableN)�
ValueError�
ignore_errors�_ignore_errors�
_raise_errors�callable� TypeError�on_error�search�filter�exclude�filter_dirs�exclude_dirs� max_depth�superr �__init__)
�selfr"