/usr/local/lib/python3.6/site-packages/fsspec/__pycache__
NameSizeModeActions
archive.cpython-36.pyc26790644editdlrm
asyn.cpython-36.pyc232500644editdlrm
caching.cpython-36.pyc133250644editdlrm
callbacks.cpython-36.pyc59270644editdlrm
compression.cpython-36.pyc46450644editdlrm
config.cpython-36.pyc27400644editdlrm
conftest.cpython-36.pyc13610644editdlrm
core.cpython-36.pyc202340644editdlrm
dircache.cpython-36.pyc32920644editdlrm
exceptions.cpython-36.pyc7330644editdlrm
fuse.cpython-36.pyc101100644editdlrm
gui.cpython-36.pyc142140644editdlrm
mapping.cpython-36.pyc82080644editdlrm
parquet.cpython-36.pyc111810644editdlrm
registry.cpython-36.pyc76210644editdlrm
spec.cpython-36.pyc522480644editdlrm
transaction.cpython-36.pyc31780644editdlrm
utils.cpython-36.pyc144030644editdlrm
_version.cpython-36.pyc4640644editdlrm
__init__.cpython-36.pyc13940644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/fsspec/__pycache__/fuse.cpython-36.pyc (10110B)
3 8%Eg@'@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z m Z m Z m Z ddlmZddlmZejdZGddde Zd d d efd d Zd dZedkrddlZeejdddS)N)EIOENOENT)FUSE FuseOSError LoggingMixIn Operations) __version__) url_to_fsz fsspec.fusec@s|eZdZdddZdddZddZd d Zd d Zd dZddZ dddZ ddZ d ddZ ddZ ddZddZdS)!FUSErFcCs8||_i|_|jdd|_d|_tjd|||_dS)N/rzStarting FUSE at %s)fscacherstriprootcounterloggerinfo _ready_file)selfr path ready_filer5/usr/local/lib/python3.6/site-packages/fsspec/fuse.py__init__s  zFUSEr.__init__Nc Cstjd||jr$|dkr$dddSdj|j|jdgjd}y|jj|}Wnt k rlt t YnX|j d d |j d d d }|j d d}|ddkrt j|B|d<d|d<d|d<n*t j|B|d<|d|d<d|d<d|d<tj|d<tj|d<tj|d<|S)Nz getattr %s /.fuse_ready .fuse_readyfile)typest_sizer uidigid)st_uidst_gidmodeirst_moderr st_blksizesizest_nlinkst_atimest_ctimest_mtime)rriiP)rdebugrjoinrlstriprr rFileNotFoundErrorrrgetstatS_IFDIRS_IFREGtime)rrfhrdataZpermrrrgetattrs,         z FUSEr.getattrcCsJtjd|dj|j|jdg}|jj|d}dd|D}ddg|S) Nz readdir %sr r FcSsg|]}tjj|jdqS)r )osrbasenamer).0frrr :sz!FUSEr.readdir...z..)rr0r1rr2r Zls)rrr9filesrrrreaddir6s  z FUSEr.readdircCs&dj|j|jdg}|jj|dS)Nr r r)r1rr2r mkdir)rrr%rrrrD=s z FUSEr.mkdircCs&dj|j|jdg}|jj|dS)Nr r r)r1rr2r rmdir)rrrrrrEBs z FUSEr.rmdircCsFtjd|||f|jr$|dkr$dS|j|}|j||j|}|S)Nzread %s /.fuse_ready .fuse_readysready)rFrG)rr0rr seekread)rrr(offsetr9r?outrrrrIGs   z FUSEr.readcCs,tjd||f|j|}|j|t|S)Nzwrite %s)rr0r writelen)rrr:rJr9r?rrrrLRs  z FUSEr.writecCsdtjd||fdj|j|jdg}|jj||jj|d}||j|j <|j d7_ |j dS)Nz create %sr r wbr+) rr0r1rr2r touchopenr r)rrflagsfifnr?rrrcreateXs  z FUSEr.createcCsjtjd||fdj|j|jdg}|ddkr8d}nd}|jj|||j|j<|jd7_|jdS) Nzopen %sr r r)rrbrNr+) rr0r1rr2r rPr r)rrrQrSr%rrrrPas z FUSEr.opencCs2dj|j|jdg}|dkr"t|jj|dS)Nr r r)r1rr2NotImplementedErrorr rO)rrlengthr9rSrrrtruncatenszFUSEr.truncatec CsNdj|j|jdg}y|jj|dWn ttfk rHttYnXdS)Nr r F) r1rr2r ZrmIOErrorr3rr)rrrSrrrunlinkus z FUSEr.unlinkcCs\y,||jkr*|j|}|j|jj|Wn*tk rV}zt|WYdd}~XnXdS)Nr)r closepop Exceptionprint)rrr9r?errrrelease|s  z FUSEr.releasecCs8t|jdr0dj|j|jdg}|jj||StdS)Nchmodr r )hasattrr r1rr2rarV)rrr%rrrras z FUSEr.chmod)F)N)N)N)__name__ __module__ __qualname__rr;rCrDrErIrLrTrPrXrZr`rarrrrr s      r TFc s^fdd}s:tj|d}d|_|j|Sy |Wntk rXYnXdS)aiMount stuff in a local directory This uses fusepy to make it appear as if a given path on an fsspec instance is in fact resident within the local file-system. This requires that fusepy by installed, and that FUSE be available on the system (typically requiring a package to be installed with apt, yum, brew, etc.). Parameters ---------- fs: file-system instance From one of the compatible implementations path: str Location on that file-system to regard as the root directory to mount. Note that you typically should include the terminating "/" character. mount_point: str An empty directory on the local file-system where the contents of the remote path will appear. foreground: bool Whether or not calling this function will block. Operation will typically be more stable if True. threads: bool Whether or not to create threads when responding to file operations within the mounter directory. Operation will typically be more stable if False. ready_file: bool Whether the FUSE process is ready. The `.fuse_ready` file will exist in the `mount_point` directory if True. Debugging purpose. ops_class: FUSEr or Subclass of FUSEr To override the default behavior of FUSEr. For Example, logging to file. cstd dS)N)r)Z nothreads foreground)rr)rfr mount_point ops_classrrthreadsrrs zrun..)targetTN) threadingThreaddaemonstartKeyboardInterrupt) r rrgrfrirrhfuncthr)rfr rgrhrrrirruns,  rsc s Gfdddtjdtjd}|jddtd|jdtd d |jd td d |jd tdd |jddddd|jddtdd |jddddd|jddddd|jdddd d|j|}i}x|jpgD]}|j d!\}}}|s|j d"j |d#|j }|j d$r0t|d%td$ }n"|j d&rR|d%td& d2k}d*|kr|jd*d+\}} ||kr|||| <n | |i||<q|||<qW|jrtjtj|jd,d-Gd.d/d/tt} | } nt} t|jf|\} } tjd0| t|jt| |j|j|j|j|j | d1d%S)3aMount filesystem from chained URL to MOUNT_POINT. Examples: python3 -m fsspec.fuse memory /usr/share /tmp/mem python3 -m fsspec.fuse local /tmp/source /tmp/local \ -l /tmp/fsspecfuse.log You can also mount chained-URLs and use special settings: python3 -m fsspec.fuse 'filecache::zip::file://data.zip' \ / /tmp/zip \ -o 'filecache-cache_storage=/tmp/simplecache' You can specify the type of the setting by using `[int]` or `[bool]`, (`true`, `yes`, `1` represents the Boolean value `True`): python3 -m fsspec.fuse 'simplecache::ftp://ftp1.at.proftpd.org' \ /historic/packages/RPMS /tmp/ftp \ -o 'simplecache-cache_storage=/tmp/simplecache' \ -o 'simplecache-check_files=false[bool]' \ -o 'ftp-listings_expiry_time=60[int]' \ -o 'ftp-username=anonymous' \ -o 'ftp-password=xieyanbo' cseZdZfddZZS)z*main..RawDescriptionArgumentParsercs0t|j}|jd}|jj|d<dj|S)Nz r+)super format_helpsplit descriptionrr1)rusageparts)RawDescriptionArgumentParser __class__rrrus z6main..RawDescriptionArgumentParser.format_help)rcrdreru __classcell__r)rz)r{rrzsrzz fsspec.fuse)progrwz --versionversion)actionr~urlzfs url)rhelp source_pathzsource directory in fsrgzlocal directoryz-oz--optionappendz3Any options of protocol included in the chained URL)rrz-lz --log-filez%Logging FUSE debug info (Default: '')z-fz --foreground store_falsez-Running in foreground or not (Default: False)z-tz --threadsz-Running with threads support (Default: False)z-rz --ready-filezZThe `.fuse_ready` file will exist after FUSE is ready. (Debugging purpose, Default: False)=zWrong option: {!r})messagez[int]Nz[bool]1yestrue-r+z%(asctime)s %(message)s)levelfilenameformatc@s eZdZdS)zmain..LoggingFUSErN)rcrdrerrrr LoggingFUSEr,srzMounting %s to %s)rfrirrh)rrr)!argparseArgumentParsermain__doc__ add_argumentrstr parse_argsoption partitionerrorrlowerendswithintrMrvZlog_filelogging basicConfigDEBUGr rr rrr0rgrsrrfrir)argsparserkwargsitemkeysepvaluevalZfs_nameZ setting_namerZfuserr Zurl_pathr)rzrrs~      r__main__r+)rrr<r5rlr8errnorrZfuserrrrZfsspecrZ fsspec.corer getLoggerrr rsrrcsysargvrrrrs(    7u