/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
NameSizeModeActions
arrow.cpython-36.pyc73280644editdlrm
cached.cpython-36.pyc230300644editdlrm
dask.cpython-36.pyc46560644editdlrm
dbfs.cpython-36.pyc133510644editdlrm
dvc.cpython-36.pyc26220644editdlrm
ftp.cpython-36.pyc104440644editdlrm
git.cpython-36.pyc37500644editdlrm
github.cpython-36.pyc74040644editdlrm
hdfs.cpython-36.pyc70930644editdlrm
http.cpython-36.pyc207520644editdlrm
jupyter.cpython-36.pyc41310644editdlrm
libarchive.cpython-36.pyc60050644editdlrm
local.cpython-36.pyc119120644editdlrm
memory.cpython-36.pyc66970644editdlrm
reference.cpython-36.pyc161420644editdlrm
sftp.cpython-36.pyc61040644editdlrm
smb.cpython-36.pyc105910644editdlrm
tar.cpython-36.pyc45020644editdlrm
webhdfs.cpython-36.pyc147120644editdlrm
zip.cpython-36.pyc32760644editdlrm
__init__.cpython-36.pyc1560644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/tar.cpython-36.pyc (4502B)
3 8%Eg@sddlZddlZddlZddlZddlmZddlZddlmZddl m Z ddl m Z dddZ ejd ZGd d d eZGd d d eZdS)N)BufferedReader)AbstractArchiveFileSystem)compr)infer_compressionfile directory)05tarcsDeZdZdZdZdZdfdd ZddZd d Zdd d Z Z S) TarFileSystemzzCompressed Tar archives as a file-system (read-only) Supports the following formats: tar.gz, tar.bz2, tar.xz r Nc sDtjf|t|tr.tj|f|p&ij}|dkrd}yPt|drN|j}n:t|dr`|j}n(t|drr|j }nt|dr|j d}Wn2t k r}zt j d|WYdd}~XnX|dk rt|}t j d|d||dk rt||}||_tj||j|j|_tj|jd|_d|_||_d|_|jdS) Noriginalpathnameinfoz:Unable to determine file name, not inferring compression: zInferred compression z from file name )fileobj)super__init__ isinstancestrfsspecopenhasattrr rrr ExceptionloggerwarningrrZ_fo_refweakreffinalizeclose __enter__fotarfileTarFiler dir_cache index_storeindex_index)selfr r$Zstorage_options compressionkwargsrex) __class__D/usr/local/lib/python3.6/site-packages/fsspec/implementations/tar.pyrs<       zTarFileSystem.__init__cCsVi}xF|jD]<}|j}t|d|d<|jdjd}||jf||<q W||_dS)Ntyper/)r get_infotypemaprstrip offset_datar%)r'outZtirrr,r,r-r&Vs zTarFileSystem._indexcCsR|jdk rdSi|_x8|jjD]*}|j}t|d|d<||j|d<q WdS)Nr.r)r#r getmembersr0r1)r'memberrr,r,r- _get_dirsbs zTarFileSystem._get_dirsrbcKsl|dkrtd|j|\}}|ddkr2tdt|jtrF|j}n tj|j}|j|t||j|S)Nr8z#Read-only filesystem implementationr.rzCan only handle regular files) ValueErrorr%rr rcopyseekTarContainedFiler)r'rmoder)detailsoffsetZnewfor,r,r-_openms    zTarFileSystem._open)r NNN)r8) __name__ __module__ __qualname____doc__Z root_markerprotocolrr&r7r@ __classcell__r,r,)r+r-r s:  r c@sLeZdZdZddZddZdddZdd d Zd d ZddZ ddZ dS)r<z7 Represent/wrap a TarFileSystem's file object. cCs8||_|d|_||_|j|_|j|j|_d|_dS)NsizeF)rrGoftellstartendclosed)r'rHrr,r,r-rs   zTarContainedFile.__init__cCs|jj|jS)N)rHrIrJ)r'r,r,r-rIszTarContainedFile.tellcCs^|jrtd|dkr&|j|jj}||j|jkrF|j|j}|dkrRdS|jj|S)Nzfile is closedrrM)rLr9rKrHrIread)r'nr,r,r-rOszTarContainedFile.readrcCs|jrtd|dkr2tt|j|j||j}nR|dkrXtt|j|j||j}n,|dkr|tt|j|j||j}ntd|jj|dS)Nzfile is closedrrMzWhence must be (0, 1, 2)) rLr9minmaxrJrKrIrHr;)r'Ztowhencer,r,r-r;szTarContainedFile.seekcCs|jjd|_dS)NT)rHrrL)r'r,r,r-rs zTarContainedFile.closecCs|S)Nr,)r'r,r,r-rszTarContainedFile.__enter__cCs |jdS)N)r)r'exc_typeexc_valexc_tbr,r,r-__exit__szTarContainedFile.__exit__N)rY)r) rArBrCrDrrIrOr;rrrXr,r,r,r-r<s r<)r:loggingr!riorrZfsspec.archiverZfsspec.compressionrZ fsspec.utilsrr1 getLoggerrr objectr<r,r,r,r-s      n