Sindbad~EG File Manager
�
&Μgl* � �� � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z dgZ
d� Zd� Ze
j Z d� Z G d � d
� Z G d� deej$ � Z G d
� de� Zdd�Z G d� d� Zy)z�
A Path-like interface for zipfiles.
This codebase is shared between zipfile.Path in the stdlib
and zipp in PyPI. See
https://github.com/python/importlib_metadata/wiki/Development-Methodology
for more detail.
� N� )� translate�Pathc �B � t j t | � dd� S )a2
Given a path with elements separated by
posixpath.sep, generate all parents of that path.
>>> list(_parents('b/d'))
['b']
>>> list(_parents('/b/d/'))
['/b']
>>> list(_parents('b/d/f/'))
['b/d', 'b']
>>> list(_parents('b'))
[]
>>> list(_parents(''))
[]
r N)� itertools�islice� _ancestry)�paths �3/usr/local/lib/python3.12/zipfile/_path/__init__.py�_parentsr s � � ���I�d�O�Q��5�5� c # � K � | j t j � } | j t j � r=| �� t j | � \ } }| j t j � r�<yy�w)a�
Given a path with elements separated by
posixpath.sep, generate all elements of that path.
>>> list(_ancestry('b/d'))
['b/d', 'b']
>>> list(_ancestry('/b/d/'))
['/b/d', '/b']
>>> list(_ancestry('b/d/f/'))
['b/d/f', 'b/d', 'b']
>>> list(_ancestry('b'))
['b']
>>> list(_ancestry(''))
[]
Multiple separators are treated like a single.
>>> list(_ancestry('//b//d///f//'))
['//b//d///f', '//b//d', '//b']
N)�rstrip� posixpath�sep�split)r
�tails r r r + sS � �� �* �;�;�y�}�}�%�D�
�+�+�i�m�m�
$��
��_�_�T�*�
��d� �+�+�i�m�m�
$�s �A:A?�=A?c �T � t j t |� j | � S )zZ
Return items in minuend not in subtrahend, retaining order
with O(1) lookup.
)r �filterfalse�set�__contains__)�minuend�
subtrahends r �_differencer J s! � �
� � ��Z��!=�!=�w�G�Gr
c �2 � � e Zd ZdZ� fd�Zd� Z� fd�Z� xZS )�InitializedStatez?
Mix-in to save the initialization state for pickling.
c �@ �� || _ || _ t �| � |i |�� y �N)�_InitializedState__args�_InitializedState__kwargs�super�__init__)�self�args�kwargs� __class__s �r r"