/var/opt/nydus/ops/importlib_resources/__pycache__
NameSizeModeActions
abc.cpython-312.pyc94560644editdlrm
readers.cpython-312.pyc121370644editdlrm
simple.cpython-312.pyc54930644editdlrm
_adapters.cpython-312.pyc96370644editdlrm
_common.cpython-312.pyc88250644editdlrm
_functional.cpython-312.pyc36510644editdlrm
_itertools.cpython-312.pyc15650644editdlrm
__init__.cpython-312.pyc8420644editdlrm
Edit: /var/opt/nydus/ops/importlib_resources/__pycache__/readers.cpython-312.pyc (12137B)
O jj,ddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZddlmZdZGd d e j$ZGd d e j$ZGd de j*ZGdde j$ZdZy)) annotationsN)Iterator)abc)only)ZipPathcRttjj|SN)iter collections OrderedDictfromkeys)itemss L/opt/nydus/tmp/pip-target-a90h98xg/lib/python/importlib_resources/readers.pyremove_duplicatesrs  ''007 88ceZdZdZdZdZy) FileReaderc`tj|jj|_yr )pathlibPathpathparent)selfloaders r__init__zFileReader.__init__sLL-44 rcJt|jj|Sz{ Return the file system path to prevent `resources.path()` from creating a temporary copy. strrjoinpathrresources r resource_pathzFileReader.resource_path 499%%h/00rc|jSr rrs rfileszFileReader.files! yyrN)__name__ __module__ __qualname__rr$r)rrrrs51rrc0eZdZdZfdZdZdZxZS) ZipReaderc|jjdd|_|j|r-|jd\}}}|xj|dzz c_|j|_y)N\/.)prefixreplace is_package rpartitionarchive)rrmodule_names rrzZipReader.__init__&s[mm++D#6   V $**3/JAq$ KK4#: %K~~ rcv t||S#t$r}t|jdd}~wwxYwNr)super open_resourceKeyErrorFileNotFoundErrorargs)rr#exc __class__s rr@zZipReader.open_resource-s; 17(2 2 1#CHHQK0 0 1s 838c|jj|}|jxr|jS)zf Workaround for `zipfile.Path.is_file` returning true for non-existent paths. )r)r!is_fileexists)rrtargets r is_resourcezZipReader.is_resource3s2 &&t,~~3FMMO3rcBt|j|jSr )rr9r5r(s rr)zZipReader.files;st||T[[11r)r+r,r-rr@rJr) __classcell__rEs@rr0r0%s&1 42rr0creZdZdZdZdZdZdZdZdZ fdZ e d Z d Z ed Zd ZxZS) MultiplexedPathz Given a series of Traversable objects, implement a merged version of the interface across all objects. Useful for namespace packages which may be multihomed at a single name. ctttt||_|js d}t |t d|jDs tdy)Nz.MultiplexedPath must contain at least one pathc3<K|]}|jywr is_dir.0rs r z+MultiplexedPath.__init__..Ls9[T4;;=[sz)MultiplexedPath only supports directories)listmap_ensure_traversabler_pathsrBallNotADirectoryError)rpathsmessages rrzMultiplexedPath.__init__GsV324Ee4LMN {{FG#G, ,9T[[99$%PQ Q:rcd|jD}tjd}tjt |||}t |jd|DS)Nc3JK|]}|jD]}|ywr )iterdir)rUrchilds rrVz*MultiplexedPath.iterdir..PsNkdt||~eE~Eks!#r<)keyc3&K|] \}}| ywr r.)rUr<locss rrVz*MultiplexedPath.iterdir..Ss!@:4$s)rZoperator attrgetter itertoolsgroupbysortedrX_follow)rchildrenby_namegroupss rrazMultiplexedPath.iterdirOsPNdkkN%%f-""6(#@gN4<)r?r!rTraversalErrorrZ)r descendantsrEs rr!zMultiplexedPath.joinpathasJ 97#[1 1!! 9+4;;q>**K8 8 9s /AActj|d\}}} t|S#t$r% ||cYS#t$rt |cYcYSwxYwwxYw)z Construct a MultiplexedPath if needed. If children contains a sole element, return it. Otherwise, return a MultiplexedPath of the items. Unless one of the items is not a Directory, then return the first. )rhteer ValueErrorr\next)clsrlsubdirsone_dirone_files rrkzMultiplexedPath._followisa&/]]8Q%?"( &=  & &G}$% &H~% & &s) ' A8AA AAAct|drprqrus ropenzMultiplexedPath.open|rsrc4|jdjSr>)rZr<r(s rr<zMultiplexedPath.names{{1~"""rcRdjd|jD}d|dS)Nz, c3(K|] }d|d yw)'Nr.rTs rrVz+MultiplexedPath.__repr__..s>+$AdV1++szMultiplexedPath())joinrZ)rr]s r__repr__zMultiplexedPath.__repr__s) >$++>>!%**r)r+r,r-__doc__rrarrrwrSrGr! classmethodrkrpropertyr<rrLrMs@rrOrO?s_RB 999&&$9##+rrOcTeZdZdZeddZed dZed dZdZ dZ y) NamespaceReaderc dt|vr tdtttt |j ||_y)N NamespacePathz Invalid path)r rrOfilterboolrX_resolver)rnamespace_paths rrzNamespaceReader.__init__s8 #n"5 5^, ,#VD#dmm^2T%UV rcJd|j|D}t|dS)a Given an item from a namespace path, resolve it to a Traversable. path_str might be a directory on the filesystem or a path to a zipfile plus the path within the zipfile, e.g. ``/foo/bar`` or ``/foo/baz.zip/inner_dir`` or ``foo\baz.zip\inner_dir\sub``. path_str might also be a sentinel used by editable packages to trigger other behaviors (see python/importlib_resources#311). In that case, return None. c3BK|]}|js|ywr rR)rUcands rrVz+NamespaceReader._resolve..sQ!?4;;=!?sN)_candidate_pathsr)rpath_strdirss rrzNamespaceReader._resolves'R!5!5h!?QD$rc#pKtj||j|Ed{y7wr )rr_resolve_zip_path)rrs rrz NamespaceReader._candidate_pathss)ll8$$((222s ,646c#Ktttjd|D]}t j t ttt5||jdjdddz}t|d|j|jddddy#1swYxYww)Nz[\\/]r2r3)reversedrWrefinditer contextlibsuppressrBIsADirectoryErrorr\PermissionErrorendr6rstartlstrip)rmatchinners rrz!NamespaceReader._resolve_zip_pathsd2;;x#BCDE$$!!"  !/77cBSHh7c9JKKEsACAB6+ C6B? ;CcJt|jj|Srrr"s rr$zNamespaceReader.resource_pathr%rc|jSr r'r(s rr)zNamespaceReader.filesr*rN)returnzabc.Traversable | None)rr rzIterator[abc.Traversable])rr ) r+r,r-rrrr staticmethodrr$r)r.rrrrsPW     33 L L1rrct|ts|Stjdtdt j |S)zk Convert deprecated string arguments to traversables (pathlib.Path). Remove with Python 3.15. zrs}" $ 9 ))  2((24F+cooF+R0c..0fr