asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T 3 # Yh @sddlZddlZddlZddlZddlZddlZddlZejdkrPddlm Z ne Z dgZ ddZ dd Z e jZd d ZGd d d ejZGdddeZddZGdddZdS)N) OrderedDictPathcCstjt|ddS)a2 Given a path with elements separated by posixpath.sep, generate all parents of that path. >>> list(_parents('b/d')) ['b'] >>> list(_parents('/b/d/')) ['/b'] >>> list(_parents('b/d/f/')) ['b/d', 'b'] >>> list(_parents('b')) [] >>> list(_parents('')) [] N) itertoolsislice _ancestry)pathr $/tmp/pip-build-gxl7__bi/zipp/zipp.py_parentssr ccs8|jtj}x&|r2|tjkr2|Vtj|\}}qWdS)aR Given a path with elements separated by posixpath.sep, generate all elements of that path >>> list(_ancestry('b/d')) ['b/d', 'b'] >>> list(_ancestry('/b/d/')) ['/b/d', '/b'] >>> list(_ancestry('b/d/f/')) ['b/d/f', 'b/d', 'b'] >>> list(_ancestry('b')) ['b'] >>> list(_ancestry('')) [] N)rstrip posixpathsepsplit)r tailr r r r %s r cCstjt|j|S)zZ Return items in minuend not in subtrahend, retaining order with O(1) lookup. )r filterfalseset __contains__)ZminuendZ subtrahendr r r _difference?srcsHeZdZdZeddZfddZddZdd Ze d d Z Z S) CompleteDirszk A ZipFile subclass that ensures that implied directories are always included in the namelist. cCs.tjjtt|}dd|D}tt||S)Ncss|]}|tjVqdS)N)rr).0pr r r Psz-CompleteDirs._implied_dirs..)rchain from_iterablemapr _deduper)namesparentsZas_dirsr r r _implied_dirsMszCompleteDirs._implied_dirscs tt|j}|t|j|S)N)superrnamelistlistr!)selfr) __class__r r r#SszCompleteDirs.namelistcCs t|jS)N)rr#)r%r r r _name_setWszCompleteDirs._name_setcCs,|j}|d}||ko||k}|r(|S|S)zx If the name represents a directory, return that name as a directory (with the trailing slash). /)r')r%namerdirnameZ dir_matchr r r resolve_dirZszCompleteDirs.resolve_dircCs>t|tr|St|tjs&|t|Sd|jkr4t}||_|S)zl Given a source (filename or zipfile), return an appropriate CompleteDirs subclass. r) isinstancerzipfileZipFile_pathlib_compatmoder&)clssourcer r r makeds    zCompleteDirs.make) __name__ __module__ __qualname____doc__ staticmethodr!r#r'r+ classmethodr4 __classcell__r r )r&r rGs    rcs,eZdZdZfddZfddZZS) FastLookupzV ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. c s.tjt|jSQRXtt|j|_|jS)N) contextlibsuppressAttributeErrorZ_FastLookup__namesr"r<r#)r%)r&r r r#~s  zFastLookup.namelistc s.tjt|jSQRXtt|j|_|jS)N)r=r>r?Z_FastLookup__lookupr"r<r')r%)r&r r r's  zFastLookup._name_set)r5r6r7r8r#r'r;r r )r&r r<xs r<c Cs&y|jStk r t|SXdS)zi For path-like objects, convert to a filename for compatibility on Python 3.6.1 and earlier. N) __fspath__r?str)r r r r r0sr0c@seZdZdZdZd-ddZd.ddd d Zed d Zed dZ eddZ eddZ eddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*ZeZed+d,ZdS)/ru4 A pathlib-compatible interface for zip files. Consider a zip file with this structure:: . ├── a.txt └── b ├── c.txt └── d └── e.txt >>> data = io.BytesIO() >>> zf = zipfile.ZipFile(data, 'w') >>> zf.writestr('a.txt', 'content of a') >>> zf.writestr('b/c.txt', 'content of c') >>> zf.writestr('b/d/e.txt', 'content of e') >>> zf.filename = 'mem/abcde.zip' Path accepts the zipfile object itself or a filename >>> root = Path(zf) From there, several path operations are available. Directory iteration (including the zip file itself): >>> a, b = root.iterdir() >>> a Path('mem/abcde.zip', 'a.txt') >>> b Path('mem/abcde.zip', 'b/') name property: >>> b.name 'b' join with divide operator: >>> c = b / 'c.txt' >>> c Path('mem/abcde.zip', 'b/c.txt') >>> c.name 'c.txt' Read text: >>> c.read_text() 'content of c' existence: >>> c.exists() True >>> (b / 'missing.txt').exists() False Coercion to string: >>> import os >>> str(c).replace(os.sep, posixpath.sep) 'mem/abcde.zip/b/c.txt' At the root, ``name``, ``filename``, and ``parent`` resolve to the zipfile. Note these attributes are not valid and will raise a ``ValueError`` if the zipfile has no filename. >>> root.name 'abcde.zip' >>> str(root.filename).replace(os.sep, posixpath.sep) 'mem/abcde.zip' >>> str(root.parent) 'mem' z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})cCstj||_||_dS)aX Construct a Path from a ZipFile or filename. Note: When the source is an existing ZipFile object, its type (__class__) will be mutated to a specialized type. If the caller wishes to retain the original type, the caller should either create a separate ZipFile object or pass a filename. N)r<r4rootat)r%rCrDr r r __init__s z Path.__init__r,N)pwdcOst|jrt||d}|j r2|dkr2t||jj|j||d}d|krb|sV|r^td|Stj |f||S)z Open this entry as text or binary following the semantics of ``pathlib.Path.open()`` by passing arguments through to io.TextIOWrapper(). rr,)rFbz*encoding args invalid for binary operation) is_dirIsADirectoryErrorexistsFileNotFoundErrorrCopenrD ValueErrorio TextIOWrapper)r%r1rFargskwargsZzip_modestreamr r r rLsz Path.opencCstj|jjp|jjS)N)pathlibrrDr)filename)r%r r r r)sz Path.namecCstj|jjp|jjS)N)rSrrDsuffixrT)r%r r r rU sz Path.suffixcCstj|jjp|jjS)N)rSrrDsuffixesrT)r%r r r rV sz Path.suffixescCstj|jjp|jjS)N)rSrrDstemrT)r%r r r rWsz Path.stemcCstj|jjj|jS)N)rSrrCrTjoinpathrD)r%r r r rTsz Path.filenamec Os$|jd|| }|jSQRXdS)Nr,)r,)rLread)r%rPrQstrmr r r read_textszPath.read_textc Cs|jd }|jSQRXdS)Nrb)rLrY)r%rZr r r read_bytess zPath.read_bytescCstj|jjd|jjdkS)Nr()rr*rDr)r%r r r r _is_child!szPath._is_childcCs|j|j|S)N)r&rC)r%rDr r r _next$sz Path._nextcCs|j p|jjdS)Nr()rDendswith)r%r r r rH'sz Path.is_dircCs|jo|j S)N)rJrH)r%r r r is_file*sz Path.is_filecCs|j|jjkS)N)rDrCr')r%r r r rJ-sz Path.existscCs.|jstdt|j|jj}t|j|S)NzCan't listdir a file)rHrMrr_rCr#filterr^)r%subsr r r iterdir0sz Path.iterdircCstj|jj|jS)N)rjoinrCrTrD)r%r r r __str__6sz Path.__str__cCs|jj|dS)N)r%) _Path__reprformat)r%r r r __repr__9sz Path.__repr__cGs*tj|jftt|}|j|jj|S)N)rrerDrr0r_rCr+)r%othernextr r r rX<sz Path.joinpathcCs6|js|jjStj|jjd}|r,|d7}|j|S)Nr()rDrTparentrr*rr_)r%Z parent_atr r r rlBs z Path.parent)rB)r,)r5r6r7r8rgrErLpropertyr)rUrVrWrTr[r]r^r_rHrarJrdrfrirX __truediv__rlr r r r rs,L      )rr)rNrr.rr=sysrS version_info collectionsrdict__all__r r fromkeysrrr/rr<r0rr r r r s$ 1