CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
tar.cpython-310.pyc33 linesDownload Raw Back to __pycache__
1o

2��Yi�@sdddlZddlZddlZddlmZddlmZddlmZddd�Z	e�3d�ZGd	d4�d5e�ZdS)�N)�AbstractArchiveFileSystem)�compr)�infer_compression�file�	directory)�0�5�tarcsReZdZdZdZdZdZ					d�fdd�	Zdd	�Zd6d�Z	dd
d�Z7�ZS)�
TarFileSystemzzCompressed Tar archives as a file-system (read-only)8 9    Supports the following formats:10    tar.gz, tar.bz2, tar.xz11    �r	FNc	12sLt�jd13i|��|pi}t|t�r#tj|fd|i|��|_|j��}|durd}z(t|d�r3|j}nt|d�r<|j	}nt|d�rE|j14}nt|d�rP|��d}Wntyk}zt
�d|���WYd}~nd}~ww|durt|�}t
�d|�d|���|dur�t||�}||_||_tj|jd	�|_d|_||_d|_|��dS)N�protocol�original�path�name�infoz:Unable to determine file name, not inferring compression: zInferred compression z from file name )�fileobj�)�super�__init__�15isinstance�str�fsspec�openZof�hasattrr
rrr�	Exception�logger�warningrrZ_fo_ref�fo�tarfile�TarFiler	�	dir_cache�index_store�index�_index)	�selfrr!Ztarget_optionsZtarget_protocol�compression�kwargsr�ex��	__class__r��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\fsspec/implementations/tar.pyrsF	161718192021����zTarFileSystem.__init__cCsVi}|jD] }|��}t�|dd�|d<|��d�d�}||jf||<q||_dS)N�typerr�/)r	�get_info�typemap�get�rstrip�offset_datar")r$�out�tirrrrr*r#[s2223zTarFileSystem._indexcCsz|jdurdSdd�|�|j���D�|_|j��D] }|��}|d�d�|d<t�|dd�|d<||j|d<qdS)NcSsi|]	}||ddd��qS)rr)r�sizer+r)�.0�dirnamerrr*�24<dictcomp>ls��z+TarFileSystem._get_dirs.<locals>.<dictcomp>rr,r+r)	r Z
_all_dirnamesr	�getnames�25getmembersr-r0r.r/)r$�memberrrrr*�	_get_dirsgs26��zTarFileSystem._get_dirs�rbcKs>|dkrtd��|j|\}}|ddkrtd��|j�|�S)Nr<z#Read-only filesystem implementationr+rzCan only handle regular files)�27ValueErrorr"r	�extractfile)r$r�moder&�details�offsetrrr*�_openvszTarFileSystem._open)rNNNN)r<)�__name__�28__module__�__qualname__�__doc__Zroot_markerrZcachablerr#r;rB�
__classcell__rrr(r*r29s�Br30)
�loggingrrZfsspec.archiverZfsspec.compressionrZfsspec.utilsrr.�	getLoggerrr31rrrr*�<module>s3233
Aluode/PerceptionLabPortable · CoolFace