L iddlZddlZddlZddlmZddlmZddlmZdddZ ejdZ Gd d eZ y) N)AbstractArchiveFileSystem)compr)infer_compressionfile directory)05tarcNeZdZdZdZdZdZ d fd ZdZdZ d dZ xZ S) TarFileSystemzzCompressed Tar archives as a file-system (read-only) Supports the following formats: tar.gz, tar.bz2, tar.xz r Fc t |d i||xsi}t|tr7t j |fd|i||_|j j }|d} t|dr |j}nQt|dr |j}n8t|dr |j}nt|dr|jd}|&t|}tjd|d||t!||}||_||_t'j(|j$ |_d|_||_d|_|j3y#t$r"}tjd|Yd}~d}~wwxYw) Nprotocoloriginalpathnameinfoz:Unable to determine file name, not inferring compression: zInferred compression z from file name )fileobj)super__init__ isinstancestrfsspecopenofhasattrrrrr Exceptionloggerwarningrr_fo_reffotarfileTarFiler dir_cache index_storeindex_index) selfr"r&target_optionstarget_protocol compressionkwargsrex __class__s `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fsspec/implementations/tar.pyrzTarFileSystem.__init__su "6"'-2 b# kk"QQ.QDGB  D   2z*;;DR(77DR(77DR(779V,D/5  3K=@PQUPVWX  "{#B'B ??4773&  + PQSPTU s#A*E F 'FF ci}|jD]a}|j}tj|dd|d<|jdj d}||j f||<c||_y)Ntyperr/)r get_infotypemapgetrstrip offset_datar')r)outtirrs r0r(zTarFileSystem._index[ss(( /B;;=D";;tF|V> %   --dhh.?.?.AB  gq+F F hh))+ 0F??$D<..s3DL";;tF|VrXsB 4$*{ +   5 !n*-n*r;