| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/fs/__pycache__/ |
Upload File : |
o
�Q `�j � @ s8 d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlm Z dd l
mZ dd
lm
Z
ddlmZ ddlmZ ejrkdd
lmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ eeege f Z!ej"ddd�Z#edd�Z$ G dd� de%�Z&G dd� dej'e# �Z(e&� Z)e)j*Z*e)j+Z,e)jZ-e)j.Z/dS )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�Optional�MutableMapping�Text�Tuple�Type)�FS)�Info�_Fr )�bound�Stepzpath, dirs, filesc s� e Zd ZdZ d,� fdd� Zedd� �Zed d
� �Zedd� �Zed
d� �Z dd� Z
d-dd�Zdd� Zdd� Z
dd� Zdd� Zdd� Z d-dd�Z d.d d!�Zd/d"d#�Zd/d$d%�Z d.d&d'�Z d-d(d)�Z d-d*d+�Z� ZS )0�Walkera� A walker object recursively lists directories in a filesystem.
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.
FN�breadthc s� |dvrt d��|| _|r|rt d��n|r| jn| j}t|�s$td��|| _|| _|| _|| _ || _
|| _|| _t
t| ��� d S )N)r �depthz#search must be 'breadth' or 'depth'z,on_error is invalid when ignore_errors==Truezon_error must be callable)�
ValueError�
ignore_errors�_ignore_errors�
_raise_errors�callable� TypeError�on_error�search�filter�exclude�filter_dirs�exclude_dirs� max_depth�superr �__init__) �selfr r$ r% r&