Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!NZZ&__pycache__/glob.cpython-313.opt-2.pycnu[ :i SSKrSSKr\R\"\R5\"\R5--r"SS5rSrg)Nc^\rSrSr%\\S'\4S\4SjjrSrSr Sr Sr Sr S r S rS rg ) TranslatorsepscXlgNr)selfrs 9/opt/alt/python313/lib64/python3.13/zipfile/_path/glob.py__init__Translator.__init__s c`URURURU555$r)extend match_dirstranslate_corer patterns r translateTranslator.translates'{{4??4+>+>w+GHIIrcSUS3$)Nz(?s:z)\Zrs r rTranslator.extend swis##rc US3$)Nz[/]?rrs r rTranslator.match_dirs+s )4  rc URU5 SR[UR[ UR U5555$)N)restrict_rglobjoinmapreplaceseparatestar_not_emptyrs r rTranslator.translate_core3s< G$wws4<<$2E2Eg2N)OPQQrc URS5=(dw [R"URS55RSS5RSS[R"UR5S35RSS 5$) Nsetrz\*\*z.*z\*[^z]*z\?z[^/])groupreescaper!r)r matchs r r!Translator.replaceBsi{{5! IIekk!n % WXu % WUr"))DII"6!7r: ; WUG $  rcS[R"UR5S3n[R"X!5n[ SU55(a [ S5eg)N[]+c3D# UHnSU;=(a US:gv M g7f)z**Nr).0segments r ,Translator.restrict_rglob..Xs K(wtw27d?2(s z&** must appear alone in a path segment)r)r*rsplitany ValueError)r r seps_patternsegmentss r rTranslator.restrict_rglobMsQBIIdii014 88L2 K(K K KEF F Lrc~SnS[R"UR5S3n[R"X2U5$)Nc8URS5nUS:XaS$U$)Nr*z?*)r()r+r2s r handle_segment1Translator.star_not_empty..handle_segment`s kk!nG"c>4 6w 6rr'r/)r)r*rsub)r rr>not_seps_patterns r r#Translator.star_not_empty[s8  7!499!5 6b9vv&@@rr N)__name__ __module__ __qualname____firstlineno__str__annotations__ _default_sepsr rrrrr!rr#__static_attributes__rrr rrs? I#0SJ $! R   G Arrc0[R"SU5$)Nz+([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$))r)finditer)rs r r"r"hs ;;Ew OOr) osr)seprGaltsepboolrIrr"rrr rQsC RYY$ryy/99 ^A^AB PrPK!@rNN$__pycache__/__init__.cpython-313.pycnu[ :i.SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK J r S/r Sr Sr\R rSr"S S 5r"S S \\ R(5r"S S\5rSSjr"SS5rg)z A Path-like interface for zipfiles. This codebase is shared between zipfile.Path in the stdlib and zipp in PyPI. See https://github.com/python/importlib_metadata/wiki/Development-Methodology for more detail. N) TranslatorPathcD[R"[U5SS5$)z 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('')) [] rN) itertoolsislice _ancestry)paths =/opt/alt/python313/lib64/python3.13/zipfile/_path/__init__.py_parentsr s   IdOQ 55c## UR[R5nUR[R5(aCUv [R"U5upUR[R5(aMBgg7f)a 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('')) [] Multiple separators are treated like a single. >>> list(_ancestry('//b//d///f//')) ['//b//d///f', '//b//d', '//b'] N)rstrip posixpathsepsplit)r tails r r r ,sV* ;;y}} %D ++imm $ $ __T*  ++imm $ $s BB B cV[R"[U5RU5$)zN Return items in minuend not in subtrahend, retaining order with O(1) lookup. )r filterfalseset __contains__)minuend subtrahends r _differencerKs!  Z!=!=w GGr c>^\rSrSrSrU4SjrSrU4SjrSrU=r $)InitializedStateSz7 Mix-in to save the initialization state for pickling. c>>XlX l[TU] "U0UD6 gN)_InitializedState__args_InitializedState__kwargssuper__init__)selfargskwargs __class__s r r#InitializedState.__init__Xs   $)&)r c2URUR4$r)r r!r$s r __getstate__InitializedState.__getstate__]s{{DMM))r c.>Uup#[TU]"U0UD6 gr)r"r#)r$stater%r&r's r __setstate__InitializedState.__setstate__`s  $)&)r )__args__kwargs) __name__ __module__ __qualname____firstlineno____doc__r#r+r/__static_attributes__ __classcell__r's@r rrSs* ***r rc^\rSrSrSr\S5rU4SjrSrSr U4Sjr \ S5r \ S \ RS \ R4S j5rS rU=r$) CompleteDirsea A ZipFile subclass that ensures that implied directories are always included in the namelist. >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) ['foo/', 'foo/bar/'] >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) ['foo/'] c[RR[[U55nSU5n[ [ X 55$)Nc3F# UHo[R-v M g7fr)rr).0ps r -CompleteDirs._implied_dirs..ss6gy}}$gs!)rchain from_iterablemapr _deduper)namesparentsas_dirss r _implied_dirsCompleteDirs._implied_dirsps7////He0DE6g6{7233r cZ>[TU]5nU[URU55-$r)r"namelistlistrK)r$rHr's r rNCompleteDirs.namelistvs+ "tD..u5666r c4[UR55$r)rrNr*s r _name_setCompleteDirs._name_setzs4==?##r c`UR5nUS-nX;=(a X2;nU(aU$U$)z` If the name represents a directory, return that name as a directory (with the trailing slash). /)rR)r$namerHdirname dir_matchs r resolve_dirCompleteDirs.resolve_dir}s6  *%:'*: #w--r c>[TU]U5$![aA URS5(aXR 5;ae[ R "US9s$f=f)z& Supplement getinfo for implied dirs. rU)filename)r"getinfoKeyErrorendswithrRzipfileZipInfo)r$rVr's r r]CompleteDirs.getinfosS 27?4( ( 2==%%^^5E)E??D1 1 2sAAAc[U[5(aU$[U[R5(dU"U5$SUR;a[nXlU$)zT Given a source (filename or zipfile), return an appropriate CompleteDirs subclass. r) isinstancer<r`ZipFilemoder')clssources r makeCompleteDirs.makesO fl + +M&'//22v;  fkk !C r zfreturncvURUR55HnURUS5 M U$)zq Given a writable zip file zf, inject directory entries for any directories implied by the presence of children. r )rKrNwritestr)rhrlrVs r injectCompleteDirs.injects2 %%bkkm4D KKc "5 r )r3r4r5r6r7 staticmethodrKrNrRrYr] classmethodrjr`rfrpr8r9r:s@r r<r<esn44 7$. 2$GOOr r<c8^\rSrSrSrU4SjrU4SjrSrU=r$) FastLookupzJ ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. c>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r) contextlibsuppressAttributeError_FastLookup__namesr"rNr$r's r rNFastLookup.namelists=   0<<1 0 0w') || 2 Ac>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r)ryrzr{_FastLookup__lookupr"rRr}s r rRFastLookup._name_sets=   0==1 0 0)+ }}r)__lookup__names) r3r4r5r6r7rNrRr8r9r:s@r rvrvs  r rvc[RRS:HnU=(a [RS:nSU-n[R "X5X4$)Npypy)r)sysimplementationrVpypy_version_infoio text_encoding)encodingr%r&is_pypy is_old_pypi stack_levels r _extract_text_encodingrsN  %%/G@c33j@Kk/K  H 2D @@r c\rSrSrSrSrS"SjrSrSrS#SS.S jjr S r \ S 5r \ S 5r \ S 5r\ S5r\ S5rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr \ r!\ S 5r"S!r#g)$ru A :class:`importlib.resources.abc.Traversable` interface for zip files. Implements many of the features users enjoy from :class:`pathlib.Path`. Consider a zip file with this structure:: . ├── a.txt └── b ├── c.txt └── d └── e.txt >>> data = io.BytesIO() >>> zf = 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 >>> path = Path(zf) From there, several path operations are available. Directory iteration (including the zip file itself): >>> a, b = path.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(encoding='utf-8') '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. >>> str(path) 'mem/abcde.zip/' >>> path.name 'abcde.zip' >>> path.filename == pathlib.Path('mem/abcde.zip') True >>> str(path.parent) 'mem' If the zipfile has no filename, such attributes are not valid and accessing them will raise an Exception. >>> zf.filename = None >>> path.name Traceback (most recent call last): ... TypeError: ... >>> path.filename Traceback (most recent call last): ... TypeError: ... >>> path.parent Traceback (most recent call last): ... TypeError: ... # workaround python/cpython#106763 >>> pass z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})cD[RU5UlX lg)a  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)rvrjrootat)r$rrs r r# Path.__init__5sOOD) r cURURLa[$URUR4URUR4:H$)z= >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo' False )r'NotImplementedrr)r$others r __eq__ Path.__eq__Bs? >> 0! ! 477# EHH'===r cD[URUR45$r)hashrrr*s r __hash__ Path.__hash__KsTYY())r NpwdcrUR5(a [U5eUSnUS:Xa UR5(d [U5eURR UR XRS9nSU;aU(dU(a [S5eU$[U0UD6upsn[R"Xg/UQ70UD6$)z Open this entry as text or binary following the semantics of ``pathlib.Path.open()`` by passing arguments through to io.TextIOWrapper(). rrdrbz*encoding args invalid for binary operation) is_dirIsADirectoryErrorexistsFileNotFoundErrorropenr ValueErrorrr TextIOWrapper)r$rgrr%r&zip_modestreamrs r r Path.openNs ;;==#D) )7 s?4;;==#D) ); $;v !MNNM!7!H!HB4B6BBr c|UR(a [R"UR5$UR$r)rpathlib PurePosixPathr\r*s r _base Path._basebs&15w$$TWW-KdmmKr c6UR5R$r)rrVr*s r rV Path.nameezz|   r c6UR5R$r)rsuffixr*s r r Path.suffixiszz|"""r c6UR5R$r)rsuffixesr*s r r Path.suffixesmszz|$$$r c6UR5R$r)rstemr*s r r Path.stemqrr c[R"URR5R UR 5$r)rrrr\joinpathrr*s r r\ Path.filenameus*||DII../88AAr c[U0UD6up1nUR"SU/UQ70UD6nUR5sSSS5 $!,(df  g=f)Nrd)rrread)r$r%r&rstrms r read_textPath.read_textysE!7!H!H YYsH 6t 6v 6$99;7 6 6s A AczURS5nUR5sSSS5 $!,(df  g=f)Nrb)rr)r$rs r read_bytesPath.read_bytes~s" YYt_99;__s, :c[R"URRS55URRS5:H$NrU)rrWrr)r$r s r _is_childPath._is_childs2  !459LLLr c:URURU5$r)r'r)r$rs r _next Path._nexts~~dii,,r chUR(+=(d URRS5$r)rr_r*s r r Path.is_dirs"77{3dgg..s33r cZUR5=(a UR5(+$r)rrr*s r is_file Path.is_files{{}2T[[]!22r cPURURR5;$r)rrrRr*s r r Path.existssww$))--///r cUR5(d [S5e[URURR 55n[ URU5$)NzCan't listdir a file)rrrFrrrNfilterr)r$subss r iterdir Path.iterdirsG{{}}34 44::tyy1134dnnd++r c`[R"UR5RU5$r)rrrmatch)r$ path_patterns r r Path.matchs"$$TWW-33LAAr cURRUR5nURS- n[R "U5$)z( Return whether this path is a symlink. )rr]r external_attrstatS_ISLNK)r$inforgs r is_symlinkPath.is_symlinks;yy  )!!R'||D!!r cPU(d[SU<35e[R"UR5n[ SS9n[R "X#R U5-5Rn[UR[X@RR555$)NzUnacceptable pattern: rU)seps) rreescaperrcompile translate fullmatchrFrrrrN)r$patternprefixtrmatchess r glob Path.globsw5g[AB B477# S !**Vll7&;;<FF4::vgyy/A/A/CDEEr c*URSU35$)Nz**/)r)r$rs r rglob Path.rglobsyy3wi))r cn[R"[U5[UR"U655$r)rrelpathstrr)r$rextras r relative_toPath.relative_tos'  TC0F,GHHr cl[R"URRUR5$r)rjoinrr\rr*s r __str__ Path.__str__s!~~dii00$''::r c4URRUS9$)Nr*) _Path__reprformatr*s r __repr__ Path.__repr__s{{!!t!,,r c[R"UR/UQ76nURURR U55$r)rrrrrrY)r$rnexts r r Path.joinpaths7~~dgg..zz$))//566r cUR(dURR$[R"URR S55nU(aUS- nUR U5$r)rr\parentrrWrr)r$ parent_ats r r Path.parentsRww=='' '%%dggnnS&9:   Izz)$$r )rr))rd)$r3r4r5r6r7rr#rrrrpropertyrVrrrr\rrrrrrrrrrrrrrr r __truediv__rr8rrr r rrsdLNF >*CC(L!!##%%!!BB M-430, B"F*I;-7K %%r r)r7ryrrrrrrrr`rr__all__r r dictfromkeysrGrrrfr<rvrrrrr r rs   (6&+6 --/H**$H#W__HV$Ax%x%r PK!߬ __pycache__/glob.cpython-313.pycnu[ :i SSKrSSKr\R\"\R5\"\R5--r"SS5rSrg)Ncb\rSrSr%Sr\\S'\4S\4SjjrSr Sr Sr Sr S r S rS rS rg ) Translatorz >>> Translator('xyz') Traceback (most recent call last): ... AssertionError: Invalid separators >>> Translator('') Traceback (most recent call last): ... AssertionError: Invalid separators sepscdU(a[U5[[5::dS5eXlg)NzInvalid separators)set _default_sepsr)selfrs 9/opt/alt/python313/lib64/python3.13/zipfile/_path/glob.py__init__Translator.__init__s&D S%77M9MM7 c`URURURU555$)z8 Given a glob pattern, produce a regex that matches it. )extend match_dirstranslate_corer patterns r translateTranslator.translates'{{4??4+>+>w+GHIIrcSUS3$)z Extend regex for pattern-wide concerns. Apply '(?s:)' to create a non-matching group that matches newlines (valid on Unix). Append '\Z' to imply fullmatch even when match is used. z(?s:z)\Zrs r rTranslator.extend swis##rc US3$)zl Ensure that zipfile.Path directory names are matched. zipfile.Path directory names always end in a slash. z[/]?rrs r rTranslator.match_dirs+s )4  rc URU5 SR[UR[ UR U5555$)z Given a glob pattern, produce a regex that matches it. >>> t = Translator() >>> t.translate_core('*.txt').replace('\\\\', '') '[^/]*\\.txt' >>> t.translate_core('a?txt') 'a[^/]txt' >>> t.translate_core('**/*').replace('\\\\', '') '.*/[^/][^/]*' )restrict_rglobjoinmapreplaceseparatestar_not_emptyrs r rTranslator.translate_core3s< G$wws4<<$2E2Eg2N)OPQQrc URS5=(dw [R"URS55RSS5RSS[R"UR5S35RSS 5$) z= Perform the replacements for a match from :func:`separate`. rrz\*\*z.*z\*[^z]*z\?z[^/])groupreescaper!r)r matchs r r!Translator.replaceBsi{{5! IIekk!n % WXu % WUr"))DII"6!7r: ; WUG $  rcS[R"UR5S3n[R"X!5n[ SU55(a [ S5eg)z Raise ValueError if ** appears in anything but a full path segment. >>> Translator().translate('**foo') Traceback (most recent call last): ... ValueError: ** must appear alone in a path segment []+c3D# UHnSU;=(a US:gv M g7f)z**Nr).0segments r ,Translator.restrict_rglob..Xs K(wtw27d?2(s z&** must appear alone in a path segmentN)r(r)rsplitany ValueError)r r seps_patternsegmentss r rTranslator.restrict_rglobMsQBIIdii014 88L2 K(K K KEF F Lrc~SnS[R"UR5S3n[R"X2U5$)z0 Ensure that * will not match an empty segment. c8URS5nUS:XaS$U$)Nr*z?*)r')r*r1s r handle_segment1Translator.star_not_empty..handle_segment`s kk!nG"c>4 6w 6rr&r.)r(r)rsub)r rr=not_seps_patterns r r#Translator.star_not_empty[s8  7!499!5 6b9vv&@@r)rN)__name__ __module__ __qualname____firstlineno____doc__str__annotations__r r rrrrr!rr#__static_attributes__rrr rrsD  I#0SJ $! R   G Arrc0[R"SU5$)z Separate out character sets to avoid translating their contents. >>> [m.group(0) for m in separate('*.txt')] ['*.txt'] >>> [m.group(0) for m in separate('a[?]txt')] ['a', '[?]', 'txt'] z+([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$))r(finditer)rs r r"r"hs ;;Ew OOr) osr(seprGaltsepboolr rr"rrr rPsC RYY$ryy/99 ^A^AB PrPK!@rNN*__pycache__/__init__.cpython-313.opt-1.pycnu[ :i.SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK J r S/r Sr Sr\R rSr"S S 5r"S S \\ R(5r"S S\5rSSjr"SS5rg)z A Path-like interface for zipfiles. This codebase is shared between zipfile.Path in the stdlib and zipp in PyPI. See https://github.com/python/importlib_metadata/wiki/Development-Methodology for more detail. N) TranslatorPathcD[R"[U5SS5$)z 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('')) [] rN) itertoolsislice _ancestry)paths =/opt/alt/python313/lib64/python3.13/zipfile/_path/__init__.py_parentsr s   IdOQ 55c## UR[R5nUR[R5(aCUv [R"U5upUR[R5(aMBgg7f)a 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('')) [] Multiple separators are treated like a single. >>> list(_ancestry('//b//d///f//')) ['//b//d///f', '//b//d', '//b'] N)rstrip posixpathsepsplit)r tails r r r ,sV* ;;y}} %D ++imm $ $ __T*  ++imm $ $s BB B cV[R"[U5RU5$)zN Return items in minuend not in subtrahend, retaining order with O(1) lookup. )r filterfalseset __contains__)minuend subtrahends r _differencerKs!  Z!=!=w GGr c>^\rSrSrSrU4SjrSrU4SjrSrU=r $)InitializedStateSz7 Mix-in to save the initialization state for pickling. c>>XlX l[TU] "U0UD6 gN)_InitializedState__args_InitializedState__kwargssuper__init__)selfargskwargs __class__s r r#InitializedState.__init__Xs   $)&)r c2URUR4$r)r r!r$s r __getstate__InitializedState.__getstate__]s{{DMM))r c.>Uup#[TU]"U0UD6 gr)r"r#)r$stater%r&r's r __setstate__InitializedState.__setstate__`s  $)&)r )__args__kwargs) __name__ __module__ __qualname____firstlineno____doc__r#r+r/__static_attributes__ __classcell__r's@r rrSs* ***r rc^\rSrSrSr\S5rU4SjrSrSr U4Sjr \ S5r \ S \ RS \ R4S j5rS rU=r$) CompleteDirsea A ZipFile subclass that ensures that implied directories are always included in the namelist. >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) ['foo/', 'foo/bar/'] >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) ['foo/'] c[RR[[U55nSU5n[ [ X 55$)Nc3F# UHo[R-v M g7fr)rr).0ps r -CompleteDirs._implied_dirs..ss6gy}}$gs!)rchain from_iterablemapr _deduper)namesparentsas_dirss r _implied_dirsCompleteDirs._implied_dirsps7////He0DE6g6{7233r cZ>[TU]5nU[URU55-$r)r"namelistlistrK)r$rHr's r rNCompleteDirs.namelistvs+ "tD..u5666r c4[UR55$r)rrNr*s r _name_setCompleteDirs._name_setzs4==?##r c`UR5nUS-nX;=(a X2;nU(aU$U$)z` If the name represents a directory, return that name as a directory (with the trailing slash). /)rR)r$namerHdirname dir_matchs r resolve_dirCompleteDirs.resolve_dir}s6  *%:'*: #w--r c>[TU]U5$![aA URS5(aXR 5;ae[ R "US9s$f=f)z& Supplement getinfo for implied dirs. rU)filename)r"getinfoKeyErrorendswithrRzipfileZipInfo)r$rVr's r r]CompleteDirs.getinfosS 27?4( ( 2==%%^^5E)E??D1 1 2sAAAc[U[5(aU$[U[R5(dU"U5$SUR;a[nXlU$)zT Given a source (filename or zipfile), return an appropriate CompleteDirs subclass. r) isinstancer<r`ZipFilemoder')clssources r makeCompleteDirs.makesO fl + +M&'//22v;  fkk !C r zfreturncvURUR55HnURUS5 M U$)zq Given a writable zip file zf, inject directory entries for any directories implied by the presence of children. r )rKrNwritestr)rhrlrVs r injectCompleteDirs.injects2 %%bkkm4D KKc "5 r )r3r4r5r6r7 staticmethodrKrNrRrYr] classmethodrjr`rfrpr8r9r:s@r r<r<esn44 7$. 2$GOOr r<c8^\rSrSrSrU4SjrU4SjrSrU=r$) FastLookupzJ ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. c>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r) contextlibsuppressAttributeError_FastLookup__namesr"rNr$r's r rNFastLookup.namelists=   0<<1 0 0w') || 2 Ac>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r)ryrzr{_FastLookup__lookupr"rRr}s r rRFastLookup._name_sets=   0==1 0 0)+ }}r)__lookup__names) r3r4r5r6r7rNrRr8r9r:s@r rvrvs  r rvc[RRS:HnU=(a [RS:nSU-n[R "X5X4$)Npypy)r)sysimplementationrVpypy_version_infoio text_encoding)encodingr%r&is_pypy is_old_pypi stack_levels r _extract_text_encodingrsN  %%/G@c33j@Kk/K  H 2D @@r c\rSrSrSrSrS"SjrSrSrS#SS.S jjr S r \ S 5r \ S 5r \ S 5r\ S5r\ S5rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr \ r!\ S 5r"S!r#g)$ru A :class:`importlib.resources.abc.Traversable` interface for zip files. Implements many of the features users enjoy from :class:`pathlib.Path`. Consider a zip file with this structure:: . ├── a.txt └── b ├── c.txt └── d └── e.txt >>> data = io.BytesIO() >>> zf = 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 >>> path = Path(zf) From there, several path operations are available. Directory iteration (including the zip file itself): >>> a, b = path.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(encoding='utf-8') '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. >>> str(path) 'mem/abcde.zip/' >>> path.name 'abcde.zip' >>> path.filename == pathlib.Path('mem/abcde.zip') True >>> str(path.parent) 'mem' If the zipfile has no filename, such attributes are not valid and accessing them will raise an Exception. >>> zf.filename = None >>> path.name Traceback (most recent call last): ... TypeError: ... >>> path.filename Traceback (most recent call last): ... TypeError: ... >>> path.parent Traceback (most recent call last): ... TypeError: ... # workaround python/cpython#106763 >>> pass z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})cD[RU5UlX lg)a  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)rvrjrootat)r$rrs r r# Path.__init__5sOOD) r cURURLa[$URUR4URUR4:H$)z= >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo' False )r'NotImplementedrr)r$others r __eq__ Path.__eq__Bs? >> 0! ! 477# EHH'===r cD[URUR45$r)hashrrr*s r __hash__ Path.__hash__KsTYY())r NpwdcrUR5(a [U5eUSnUS:Xa UR5(d [U5eURR UR XRS9nSU;aU(dU(a [S5eU$[U0UD6upsn[R"Xg/UQ70UD6$)z Open this entry as text or binary following the semantics of ``pathlib.Path.open()`` by passing arguments through to io.TextIOWrapper(). rrdrbz*encoding args invalid for binary operation) is_dirIsADirectoryErrorexistsFileNotFoundErrorropenr ValueErrorrr TextIOWrapper)r$rgrr%r&zip_modestreamrs r r Path.openNs ;;==#D) )7 s?4;;==#D) ); $;v !MNNM!7!H!HB4B6BBr c|UR(a [R"UR5$UR$r)rpathlib PurePosixPathr\r*s r _base Path._basebs&15w$$TWW-KdmmKr c6UR5R$r)rrVr*s r rV Path.nameezz|   r c6UR5R$r)rsuffixr*s r r Path.suffixiszz|"""r c6UR5R$r)rsuffixesr*s r r Path.suffixesmszz|$$$r c6UR5R$r)rstemr*s r r Path.stemqrr c[R"URR5R UR 5$r)rrrr\joinpathrr*s r r\ Path.filenameus*||DII../88AAr c[U0UD6up1nUR"SU/UQ70UD6nUR5sSSS5 $!,(df  g=f)Nrd)rrread)r$r%r&rstrms r read_textPath.read_textysE!7!H!H YYsH 6t 6v 6$99;7 6 6s A AczURS5nUR5sSSS5 $!,(df  g=f)Nrb)rr)r$rs r read_bytesPath.read_bytes~s" YYt_99;__s, :c[R"URRS55URRS5:H$NrU)rrWrr)r$r s r _is_childPath._is_childs2  !459LLLr c:URURU5$r)r'r)r$rs r _next Path._nexts~~dii,,r chUR(+=(d URRS5$r)rr_r*s r r Path.is_dirs"77{3dgg..s33r cZUR5=(a UR5(+$r)rrr*s r is_file Path.is_files{{}2T[[]!22r cPURURR5;$r)rrrRr*s r r Path.existssww$))--///r cUR5(d [S5e[URURR 55n[ URU5$)NzCan't listdir a file)rrrFrrrNfilterr)r$subss r iterdir Path.iterdirsG{{}}34 44::tyy1134dnnd++r c`[R"UR5RU5$r)rrrmatch)r$ path_patterns r r Path.matchs"$$TWW-33LAAr cURRUR5nURS- n[R "U5$)z( Return whether this path is a symlink. )rr]r external_attrstatS_ISLNK)r$inforgs r is_symlinkPath.is_symlinks;yy  )!!R'||D!!r cPU(d[SU<35e[R"UR5n[ SS9n[R "X#R U5-5Rn[UR[X@RR555$)NzUnacceptable pattern: rU)seps) rreescaperrcompile translate fullmatchrFrrrrN)r$patternprefixtrmatchess r glob Path.globsw5g[AB B477# S !**Vll7&;;<FF4::vgyy/A/A/CDEEr c*URSU35$)Nz**/)r)r$rs r rglob Path.rglobsyy3wi))r cn[R"[U5[UR"U655$r)rrelpathstrr)r$rextras r relative_toPath.relative_tos'  TC0F,GHHr cl[R"URRUR5$r)rjoinrr\rr*s r __str__ Path.__str__s!~~dii00$''::r c4URRUS9$)Nr*) _Path__reprformatr*s r __repr__ Path.__repr__s{{!!t!,,r c[R"UR/UQ76nURURR U55$r)rrrrrrY)r$rnexts r r Path.joinpaths7~~dgg..zz$))//566r cUR(dURR$[R"URR S55nU(aUS- nUR U5$r)rr\parentrrWrr)r$ parent_ats r r Path.parentsRww=='' '%%dggnnS&9:   Izz)$$r )rr))rd)$r3r4r5r6r7rr#rrrrpropertyrVrrrr\rrrrrrrrrrrrrrr r __truediv__rr8rrr r rrsdLNF >*CC(L!!##%%!!BB M-430, B"F*I;-7K %%r r)r7ryrrrrrrrr`rr__all__r r dictfromkeysrGrrrfr<rvrrrrr r rs   (6&+6 --/H**$H#W__HV$Ax%x%r PK!9rr&__pycache__/glob.cpython-313.opt-1.pycnu[ :i SSKrSSKr\R\"\R5\"\R5--r"SS5rSrg)Ncb\rSrSr%Sr\\S'\4S\4SjjrSr Sr Sr Sr S r S rS rS rg ) Translatorz >>> Translator('xyz') Traceback (most recent call last): ... AssertionError: Invalid separators >>> Translator('') Traceback (most recent call last): ... AssertionError: Invalid separators sepscXlg)Nr)selfrs 9/opt/alt/python313/lib64/python3.13/zipfile/_path/glob.py__init__Translator.__init__s c`URURURU555$)z8 Given a glob pattern, produce a regex that matches it. )extend match_dirstranslate_corer patterns r translateTranslator.translates'{{4??4+>+>w+GHIIr cSUS3$)z Extend regex for pattern-wide concerns. Apply '(?s:)' to create a non-matching group that matches newlines (valid on Unix). Append '\Z' to imply fullmatch even when match is used. z(?s:z)\Zrs r rTranslator.extend swis##r c US3$)zl Ensure that zipfile.Path directory names are matched. zipfile.Path directory names always end in a slash. z[/]?rrs r rTranslator.match_dirs+s )4  r c URU5 SR[UR[ UR U5555$)z Given a glob pattern, produce a regex that matches it. >>> t = Translator() >>> t.translate_core('*.txt').replace('\\\\', '') '[^/]*\\.txt' >>> t.translate_core('a?txt') 'a[^/]txt' >>> t.translate_core('**/*').replace('\\\\', '') '.*/[^/][^/]*' )restrict_rglobjoinmapreplaceseparatestar_not_emptyrs r rTranslator.translate_core3s< G$wws4<<$2E2Eg2N)OPQQr c URS5=(dw [R"URS55RSS5RSS[R"UR5S35RSS 5$) z= Perform the replacements for a match from :func:`separate`. setrz\*\*z.*z\*[^z]*z\?z[^/])groupreescaper r)r matchs r r Translator.replaceBsi{{5! IIekk!n % WXu % WUr"))DII"6!7r: ; WUG $  r cS[R"UR5S3n[R"X!5n[ SU55(a [ S5eg)z Raise ValueError if ** appears in anything but a full path segment. >>> Translator().translate('**foo') Traceback (most recent call last): ... ValueError: ** must appear alone in a path segment []+c3D# UHnSU;=(a US:gv M g7f)z**Nr).0segments r ,Translator.restrict_rglob..Xs K(wtw27d?2(s z&** must appear alone in a path segmentN)r(r)rsplitany ValueError)r r seps_patternsegmentss r rTranslator.restrict_rglobMsQBIIdii014 88L2 K(K K KEF F Lr c~SnS[R"UR5S3n[R"X2U5$)z0 Ensure that * will not match an empty segment. c8URS5nUS:XaS$U$)Nr*z?*)r')r*r1s r handle_segment1Translator.star_not_empty..handle_segment`s kk!nG"c>4 6w 6r r&r.)r(r)rsub)r rr=not_seps_patterns r r"Translator.star_not_empty[s8  7!499!5 6b9vv&@@r rN)__name__ __module__ __qualname____firstlineno____doc__str__annotations__ _default_sepsr rrrrr rr"__static_attributes__rr r rrsD  I#0SJ $! R   G Ar rc0[R"SU5$)z Separate out character sets to avoid translating their contents. >>> [m.group(0) for m in separate('*.txt')] ['*.txt'] >>> [m.group(0) for m in separate('a[?]txt')] ['a', '[?]', 'txt'] z+([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$))r(finditer)rs r r!r!hs ;;Ew OOr ) osr(seprGaltsepboolrIrr!rr r rQsC RYY$ryy/99 ^A^AB Pr PK!>>*__pycache__/__init__.cpython-313.opt-2.pycnu[ :i.SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK J r S/r Sr Sr \RrSr"SS 5r"S S \\R&5r"S S \5rSSjr"SS5rg)N) TranslatorPathcD[R"[U5SS5$)Nr) itertoolsislice _ancestry)paths =/opt/alt/python313/lib64/python3.13/zipfile/_path/__init__.py_parentsr s   IdOQ 55c## UR[R5nUR[R5(aCUv [R"U5upUR[R5(aMBgg7fN)rstrip posixpathsepsplit)r tails r r r ,sV* ;;y}} %D ++imm $ $ __T*  ++imm $ $s BB B cV[R"[U5RU5$r)r filterfalseset __contains__)minuend subtrahends r _differencerKs!  Z!=!=w GGr c:^\rSrSrU4SjrSrU4SjrSrU=r$)InitializedStateSc>>XlX l[TU] "U0UD6 gr)_InitializedState__args_InitializedState__kwargssuper__init__)selfargskwargs __class__s r r#InitializedState.__init__Xs   $)&)r c2URUR4$r)r r!r$s r __getstate__InitializedState.__getstate__]s{{DMM))r c.>Uup#[TU]"U0UD6 gr)r"r#)r$stater%r&r's r __setstate__InitializedState.__setstate__`s  $)&)r )__args__kwargs) __name__ __module__ __qualname____firstlineno__r#r+r/__static_attributes__ __classcell__r's@r rrSs * ***r rc^\rSrSr\S5rU4SjrSrSrU4Sjr \ S5r \ S\ RS \ R4S j5rS rU=r$) CompleteDirsec[RR[[U55nSU5n[ [ X 55$)Nc3F# UHo[R-v M g7fr)rr).0ps r -CompleteDirs._implied_dirs..ss6gy}}$gs!)rchain from_iterablemapr _deduper)namesparentsas_dirss r _implied_dirsCompleteDirs._implied_dirsps7////He0DE6g6{7233r cZ>[TU]5nU[URU55-$r)r"namelistlistrJ)r$rGr's r rMCompleteDirs.namelistvs+ "tD..u5666r c4[UR55$r)rrMr*s r _name_setCompleteDirs._name_setzs4==?##r c`UR5nUS-nX;=(a X2;nU(aU$U$N/)rQ)r$namerGdirname dir_matchs r resolve_dirCompleteDirs.resolve_dir}s6  *%:'*: #w--r c>[TU]U5$![aA URS5(aXR 5;ae[ R "US9s$f=f)NrU)filename)r"getinfoKeyErrorendswithrQzipfileZipInfo)r$rVr's r r]CompleteDirs.getinfosS 27?4( ( 2==%%^^5E)E??D1 1 2sAAAc[U[5(aU$[U[R5(dU"U5$SUR;a[nXlU$Nr) isinstancer;r`ZipFilemoder')clssources r makeCompleteDirs.makesO fl + +M&'//22v;  fkk !C r zfreturncvURUR55HnURUS5 M U$)Nr )rJrMwritestr)rirmrVs r injectCompleteDirs.injects2 %%bkkm4D KKc "5 r )r3r4r5r6 staticmethodrJrMrQrYr] classmethodrkr`rgrqr7r8r9s@r r;r;esi44 7$. 2$GOOr r;c4^\rSrSrU4SjrU4SjrSrU=r$) FastLookupc>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r) contextlibsuppressAttributeError_FastLookup__namesr"rMr$r's r rMFastLookup.namelists=   0<<1 0 0w') || 2 Ac>[R"[5 URsSSS5 $!,(df  O=f[TU]5UlUR$r)rzr{r|_FastLookup__lookupr"rQr~s r rQFastLookup._name_sets=   0==1 0 0)+ }}r)__lookup__names)r3r4r5r6rMrQr7r8r9s@r rwrws  r rwc[RRS:HnU=(a [RS:nSU-n[R "X5X4$)Npypy)r)sysimplementationrVpypy_version_infoio text_encoding)encodingr%r&is_pypy is_old_pypi stack_levels r _extract_text_encodingrsN  %%/G@c33j@Kk/K  H 2D @@r c \rSrSrSrS!SjrSrSrS"SS.SjjrS r \ S 5r \ S 5r \ S 5r \ S 5r\ S5rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr\r \ S5r!S r"g)#rz>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})cD[RU5UlX lgr)rwrkrootat)r$rrs r r# Path.__init__5sOOD) r cURURLa[$URUR4URUR4:H$r)r'NotImplementedrr)r$others r __eq__ Path.__eq__Bs? >> 0! ! 477# EHH'===r cD[URUR45$r)hashrrr*s r __hash__ Path.__hash__KsTYY())r NpwdcrUR5(a [U5eUSnUS:Xa UR5(d [U5eURR UR XRS9nSU;aU(dU(a [S5eU$[U0UD6upsn[R"Xg/UQ70UD6$)Nrrerbz*encoding args invalid for binary operation) is_dirIsADirectoryErrorexistsFileNotFoundErrorropenr ValueErrorrr TextIOWrapper)r$rhrr%r&zip_modestreamrs r r Path.openNs ;;==#D) )7 s?4;;==#D) ); $;v !MNNM!7!H!HB4B6BBr c|UR(a [R"UR5$UR$r)rpathlib PurePosixPathr\r*s r _base Path._basebs&15w$$TWW-KdmmKr c6UR5R$r)rrVr*s r rV Path.nameezz|   r c6UR5R$r)rsuffixr*s r r Path.suffixiszz|"""r c6UR5R$r)rsuffixesr*s r r Path.suffixesmszz|$$$r c6UR5R$r)rstemr*s r r Path.stemqrr c[R"URR5R UR 5$r)rrrr\joinpathrr*s r r\ Path.filenameus*||DII../88AAr c[U0UD6up1nUR"SU/UQ70UD6nUR5sSSS5 $!,(df  g=frd)rrread)r$r%r&rstrms r read_textPath.read_textysE!7!H!H YYsH 6t 6v 6$99;7 6 6s A AczURS5nUR5sSSS5 $!,(df  g=f)Nrb)rr)r$rs r read_bytesPath.read_bytes~s" YYt_99;__s, :c[R"URRS55URRS5:H$rT)rrWrr)r$r s r _is_childPath._is_childs2  !459LLLr c:URURU5$r)r'r)r$rs r _next Path._nexts~~dii,,r chUR(+=(d URRS5$rT)rr_r*s r r Path.is_dirs"77{3dgg..s33r cZUR5=(a UR5(+$r)rrr*s r is_file Path.is_files{{}2T[[]!22r cPURURR5;$r)rrrQr*s r r Path.existssww$))--///r cUR5(d [S5e[URURR 55n[ URU5$)NzCan't listdir a file)rrrErrrMfilterr)r$subss r iterdir Path.iterdirsG{{}}34 44::tyy1134dnnd++r c`[R"UR5RU5$r)rrrmatch)r$ path_patterns r r Path.matchs"$$TWW-33LAAr cURRUR5nURS- n[R "U5$)N)rr]r external_attrstatS_ISLNK)r$inforhs r is_symlinkPath.is_symlinks;yy  )!!R'||D!!r cPU(d[SU<35e[R"UR5n[ SS9n[R "X#R U5-5Rn[UR[X@RR555$)NzUnacceptable pattern: rU)seps) rreescaperrcompile translate fullmatchrErrrrM)r$patternprefixtrmatchess r glob Path.globsw5g[AB B477# S !**Vll7&;;<FF4::vgyy/A/A/CDEEr c*URSU35$)Nz**/)r)r$rs r rglob Path.rglobsyy3wi))r cn[R"[U5[UR"U655$r)rrelpathstrr)r$rextras r relative_toPath.relative_tos'  TC0F,GHHr cl[R"URRUR5$r)rjoinrr\rr*s r __str__ Path.__str__s!~~dii00$''::r c4URRUS9$)Nr*) _Path__reprformatr*s r __repr__ Path.__repr__s{{!!t!,,r c[R"UR/UQ76nURURR U55$r)rrrrrrY)r$rnexts r r Path.joinpaths7~~dgg..zz$))//566r cUR(dURR$[R"URR S55nU(aUS- nUR U5$rT)rr\parentrrWrr)r$ parent_ats r r Path.parentsRww=='' '%%dggnnS&9:   Izz)$$r )rr))re)#r3r4r5r6rr#rrrrpropertyrVrrrr\rrrrrrrrrrrrrrr r __truediv__rr7rsr r rrsNNF >*CC(L!!##%%!!BB M-430, B"F*I;-7K %%r r)rzrrrrrrrr`rr__all__r r dictfromkeysrFrrrgr;rwrrrsr r rs   (6&+6 --/H**$H#W__HV$Ax%x%r PK!>ҩ glob.pynu[import os import re _default_seps = os.sep + str(os.altsep) * bool(os.altsep) class Translator: """ >>> Translator('xyz') Traceback (most recent call last): ... AssertionError: Invalid separators >>> Translator('') Traceback (most recent call last): ... AssertionError: Invalid separators """ seps: str def __init__(self, seps: str = _default_seps): assert seps and set(seps) <= set(_default_seps), "Invalid separators" self.seps = seps def translate(self, pattern): """ Given a glob pattern, produce a regex that matches it. """ return self.extend(self.match_dirs(self.translate_core(pattern))) def extend(self, pattern): r""" Extend regex for pattern-wide concerns. Apply '(?s:)' to create a non-matching group that matches newlines (valid on Unix). Append '\Z' to imply fullmatch even when match is used. """ return rf'(?s:{pattern})\Z' def match_dirs(self, pattern): """ Ensure that zipfile.Path directory names are matched. zipfile.Path directory names always end in a slash. """ return rf'{pattern}[/]?' def translate_core(self, pattern): r""" Given a glob pattern, produce a regex that matches it. >>> t = Translator() >>> t.translate_core('*.txt').replace('\\\\', '') '[^/]*\\.txt' >>> t.translate_core('a?txt') 'a[^/]txt' >>> t.translate_core('**/*').replace('\\\\', '') '.*/[^/][^/]*' """ self.restrict_rglob(pattern) return ''.join(map(self.replace, separate(self.star_not_empty(pattern)))) def replace(self, match): """ Perform the replacements for a match from :func:`separate`. """ return match.group('set') or ( re.escape(match.group(0)) .replace('\\*\\*', r'.*') .replace('\\*', rf'[^{re.escape(self.seps)}]*') .replace('\\?', r'[^/]') ) def restrict_rglob(self, pattern): """ Raise ValueError if ** appears in anything but a full path segment. >>> Translator().translate('**foo') Traceback (most recent call last): ... ValueError: ** must appear alone in a path segment """ seps_pattern = rf'[{re.escape(self.seps)}]+' segments = re.split(seps_pattern, pattern) if any('**' in segment and segment != '**' for segment in segments): raise ValueError("** must appear alone in a path segment") def star_not_empty(self, pattern): """ Ensure that * will not match an empty segment. """ def handle_segment(match): segment = match.group(0) return '?*' if segment == '*' else segment not_seps_pattern = rf'[^{re.escape(self.seps)}]+' return re.sub(not_seps_pattern, handle_segment, pattern) def separate(pattern): """ Separate out character sets to avoid translating their contents. >>> [m.group(0) for m in separate('*.txt')] ['*.txt'] >>> [m.group(0) for m in separate('a[?]txt')] ['a', '[?]', 'txt'] """ return re.finditer(r'([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$)', pattern) PK!*'ٴ.. __init__.pynu[""" A Path-like interface for zipfiles. This codebase is shared between zipfile.Path in the stdlib and zipp in PyPI. See https://github.com/python/importlib_metadata/wiki/Development-Methodology for more detail. """ import contextlib import io import itertools import pathlib import posixpath import re import stat import sys import zipfile from .glob import Translator __all__ = ['Path'] def _parents(path): """ 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('')) [] """ return itertools.islice(_ancestry(path), 1, None) def _ancestry(path): """ 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('')) [] Multiple separators are treated like a single. >>> list(_ancestry('//b//d///f//')) ['//b//d///f', '//b//d', '//b'] """ path = path.rstrip(posixpath.sep) while path.rstrip(posixpath.sep): yield path path, tail = posixpath.split(path) _dedupe = dict.fromkeys """Deduplicate an iterable in original order""" def _difference(minuend, subtrahend): """ Return items in minuend not in subtrahend, retaining order with O(1) lookup. """ return itertools.filterfalse(set(subtrahend).__contains__, minuend) class InitializedState: """ Mix-in to save the initialization state for pickling. """ def __init__(self, *args, **kwargs): self.__args = args self.__kwargs = kwargs super().__init__(*args, **kwargs) def __getstate__(self): return self.__args, self.__kwargs def __setstate__(self, state): args, kwargs = state super().__init__(*args, **kwargs) class CompleteDirs(InitializedState, zipfile.ZipFile): """ A ZipFile subclass that ensures that implied directories are always included in the namelist. >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) ['foo/', 'foo/bar/'] >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) ['foo/'] """ @staticmethod def _implied_dirs(names): parents = itertools.chain.from_iterable(map(_parents, names)) as_dirs = (p + posixpath.sep for p in parents) return _dedupe(_difference(as_dirs, names)) def namelist(self): names = super().namelist() return names + list(self._implied_dirs(names)) def _name_set(self): return set(self.namelist()) def resolve_dir(self, name): """ If the name represents a directory, return that name as a directory (with the trailing slash). """ names = self._name_set() dirname = name + '/' dir_match = name not in names and dirname in names return dirname if dir_match else name def getinfo(self, name): """ Supplement getinfo for implied dirs. """ try: return super().getinfo(name) except KeyError: if not name.endswith('/') or name not in self._name_set(): raise return zipfile.ZipInfo(filename=name) @classmethod def make(cls, source): """ Given a source (filename or zipfile), return an appropriate CompleteDirs subclass. """ if isinstance(source, CompleteDirs): return source if not isinstance(source, zipfile.ZipFile): return cls(source) # Only allow for FastLookup when supplied zipfile is read-only if 'r' not in source.mode: cls = CompleteDirs source.__class__ = cls return source @classmethod def inject(cls, zf: zipfile.ZipFile) -> zipfile.ZipFile: """ Given a writable zip file zf, inject directory entries for any directories implied by the presence of children. """ for name in cls._implied_dirs(zf.namelist()): zf.writestr(name, b"") return zf class FastLookup(CompleteDirs): """ ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. """ def namelist(self): with contextlib.suppress(AttributeError): return self.__names self.__names = super().namelist() return self.__names def _name_set(self): with contextlib.suppress(AttributeError): return self.__lookup self.__lookup = super()._name_set() return self.__lookup def _extract_text_encoding(encoding=None, *args, **kwargs): # compute stack level so that the caller of the caller sees any warning. is_pypy = sys.implementation.name == 'pypy' # PyPy no longer special cased after 7.3.19 (or maybe 7.3.18) # See jaraco/zipp#143 is_old_pypi = is_pypy and sys.pypy_version_info < (7, 3, 19) stack_level = 3 + is_old_pypi return io.text_encoding(encoding, stack_level), args, kwargs class Path: """ A :class:`importlib.resources.abc.Traversable` interface for zip files. Implements many of the features users enjoy from :class:`pathlib.Path`. Consider a zip file with this structure:: . ├── a.txt └── b ├── c.txt └── d └── e.txt >>> data = io.BytesIO() >>> zf = 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 >>> path = Path(zf) From there, several path operations are available. Directory iteration (including the zip file itself): >>> a, b = path.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(encoding='utf-8') '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. >>> str(path) 'mem/abcde.zip/' >>> path.name 'abcde.zip' >>> path.filename == pathlib.Path('mem/abcde.zip') True >>> str(path.parent) 'mem' If the zipfile has no filename, such attributes are not valid and accessing them will raise an Exception. >>> zf.filename = None >>> path.name Traceback (most recent call last): ... TypeError: ... >>> path.filename Traceback (most recent call last): ... TypeError: ... >>> path.parent Traceback (most recent call last): ... TypeError: ... # workaround python/cpython#106763 >>> pass """ __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})" def __init__(self, root, at=""): """ 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. """ self.root = FastLookup.make(root) self.at = at def __eq__(self, other): """ >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo' False """ if self.__class__ is not other.__class__: return NotImplemented return (self.root, self.at) == (other.root, other.at) def __hash__(self): return hash((self.root, self.at)) def open(self, mode='r', *args, pwd=None, **kwargs): """ Open this entry as text or binary following the semantics of ``pathlib.Path.open()`` by passing arguments through to io.TextIOWrapper(). """ if self.is_dir(): raise IsADirectoryError(self) zip_mode = mode[0] if zip_mode == 'r' and not self.exists(): raise FileNotFoundError(self) stream = self.root.open(self.at, zip_mode, pwd=pwd) if 'b' in mode: if args or kwargs: raise ValueError("encoding args invalid for binary operation") return stream # Text mode: encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) return io.TextIOWrapper(stream, encoding, *args, **kwargs) def _base(self): return pathlib.PurePosixPath(self.at) if self.at else self.filename @property def name(self): return self._base().name @property def suffix(self): return self._base().suffix @property def suffixes(self): return self._base().suffixes @property def stem(self): return self._base().stem @property def filename(self): return pathlib.Path(self.root.filename).joinpath(self.at) def read_text(self, *args, **kwargs): encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) with self.open('r', encoding, *args, **kwargs) as strm: return strm.read() def read_bytes(self): with self.open('rb') as strm: return strm.read() def _is_child(self, path): return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/") def _next(self, at): return self.__class__(self.root, at) def is_dir(self): return not self.at or self.at.endswith("/") def is_file(self): return self.exists() and not self.is_dir() def exists(self): return self.at in self.root._name_set() def iterdir(self): if not self.is_dir(): raise ValueError("Can't listdir a file") subs = map(self._next, self.root.namelist()) return filter(self._is_child, subs) def match(self, path_pattern): return pathlib.PurePosixPath(self.at).match(path_pattern) def is_symlink(self): """ Return whether this path is a symlink. """ info = self.root.getinfo(self.at) mode = info.external_attr >> 16 return stat.S_ISLNK(mode) def glob(self, pattern): if not pattern: raise ValueError(f"Unacceptable pattern: {pattern!r}") prefix = re.escape(self.at) tr = Translator(seps='/') matches = re.compile(prefix + tr.translate(pattern)).fullmatch return map(self._next, filter(matches, self.root.namelist())) def rglob(self, pattern): return self.glob(f'**/{pattern}') def relative_to(self, other, *extra): return posixpath.relpath(str(self), str(other.joinpath(*extra))) def __str__(self): return posixpath.join(self.root.filename, self.at) def __repr__(self): return self.__repr.format(self=self) def joinpath(self, *other): next = posixpath.join(self.at, *other) return self._next(self.root.resolve_dir(next)) __truediv__ = joinpath @property def parent(self): if not self.at: return self.filename.parent parent_at = posixpath.dirname(self.at.rstrip('/')) if parent_at: parent_at += '/' return self._next(parent_at) PK!NZZ&__pycache__/glob.cpython-313.opt-2.pycnu[PK!@rNN$__pycache__/__init__.cpython-313.pycnu[PK!߬ ___pycache__/glob.cpython-313.pycnu[PK!@rNN*Vt__pycache__/__init__.cpython-313.opt-1.pycnu[PK!9rr&__pycache__/glob.cpython-313.opt-1.pycnu[PK!>>*u__pycache__/__init__.cpython-313.opt-2.pycnu[PK!>ҩ glob.pynu[PK!*'ٴ.. $__init__.pynu[PKS