Ë rÚŸ‚}ãçãó@—dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ eje«Zej dej"«Zej d ej"ej&z«Zej*dd ZGd „de«Zy) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. éNé)ÚDistlibException)Úfsdecode)Ú convert_pathÚManifestz\\w* z#.*?(?= )| (?=$)écón—eZdZdZdd„Zd„Zd„Zd„Zdd„Zd„Z d „Z d „Z dd „Z dd „Z dd „Zd„Zy)rz€ A list of files built by exploring the filesystem and filtered by applying various patterns to what we find there. Ncó"—tjjtjj|xstj«««|_|j tj z|_d|_t«|_ y)zd Initialise an instance. :param base: The base directory to explore under. N) ÚosÚpathÚabspathÚnormpathÚgetcwdÚbaseÚsepÚprefixÚallfilesÚsetÚfiles)Úselfrs ú5/usr/lib/python3.12/site-packages/distlib/manifest.pyÚ__init__zManifest.__init__,sV€ô —G‘G—O‘O¤B§G¡G×$4Ñ$4°TÒ5H¼R¿Y¹Y»[Ó$IÓJˆŒ Ø—i‘i¤"§&¡&Ñ(ˆŒ ؈Œ Ü“Uˆ� ócóÆ—ddlm}m}m}gx|_}|j }|g}|j }|j}|r¥|«}tj|«} | D]€} tjj|| «} tj| «} | j} || «r|jt| ««Œg|| «sŒp|| «rŒy|| «Œ‚|rŒ¤yy)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)ÚS_ISREGÚS_ISDIRÚS_ISLNKN)ÚstatrrrrrÚpopÚappendr Úlistdirr ÚjoinÚst_moder)rrrrrÚrootÚstackrÚpushÚnamesÚnameÚfullnamerÚmodes rÚfindallzManifest.findall;s¸€÷ 3Ñ2à#%Ð%ˆŒ ˜Ø�y‰yˆØ�ˆØ�i‰iˆØ�|‰|ˆáÙ“5ˆDÜ—J‘J˜tÓ$ˆEã�ÜŸ7™7Ÿ<™<¨¨dÓ3�ô—w‘w˜xÓ(�Ø—|‘|�Ù˜4”=Ø—O‘O¤H¨XÓ$6Õ7Ù˜T•]©7°4­=Ù˜•Nðô rcóþ—|j|j«s*tjj |j |«}|j jtjj|««y)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) Ú startswithrr r r"rrÚaddr)rÚitems rr.z Manifest.addVsK€ð �‰˜tŸ{™{Ô+Ü—7‘7—<‘< § ¡ ¨4Ó0ˆDØ � ‰ �‰”r—w‘w×'Ñ'¨Ó-Õ.rcó4—|D]}|j|«Œy)z† Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r.)rÚitemsr/s rÚadd_manyzManifest.add_many`s€ó ˆDØ �H‰H�T�Nñrcó6‡‡—ˆˆfd„Št‰j«}|rz Manifest.sorted..add_dirns[ø€Ø �H‰H�QŒKÜ �L‰LÐ+¨QÔ /Ø�D—I‘IŠ~ÜŸG™GŸM™M¨!Ó,‘ �˜Ø YÑ.Ð.Ð.Ù˜˜fÕ%ðrc3óZK—|]#}tjj|«–—Œ%y­w©N)r r r9)Ú.0r s rÚ z"Manifest.sorted..}sèø€Ð>±v¨t”r—w‘w—}‘} T×*±vùs‚)+)rrr r ÚdirnameÚsortedr")rÚwantdirsÚresultr:ÚfÚ path_tupler>s` @rrDzManifest.sortedisŒù€õ  &ô�T—Z‘Z“ˆÙ Ü“5ˆDÛ�Ù˜œbŸg™gŸo™o¨aÓ0Õ1ðà �d‰NˆFäÑ>±vÓ>Ô>ó@Ù>ð/9”—‘— ‘ ˜jÒ)Ø>ñ@ð @ùò@sÁ0#Bcó0—t«|_g|_y)zClear all collected files.N)rrr)rs rÚclearzManifest.clears€ä“UˆŒ ؈� rcó—|j|«\}}}}|dk(r2|D],}|j|d¬«rŒtjd|«Œ.y|dk(r|D]}|j |d¬«Œy|dk(r2|D],}|j|d¬«rŒtjd|«Œ.y|d k(r|D]}|j |d¬«Œy|d k(r3|D]-}|j||¬ «rŒtjd ||«Œ/y|d k(r|D]}|j ||¬ «Œy|dk(r+|jd|¬ «stjd|«yy|dk(r+|j d|¬ «stjd|«yyt d|z«‚)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands ÚincludeT)Úanchorzno files found matching %rÚexcludeúglobal-includeFz3no files found matching %r anywhere in distributionúglobal-excludeúrecursive-include)rz-no files found matching %r under directory %rúrecursive-excludeÚgraftNz no directories found matching %rÚprunez4no previously-included directories found matching %rzinvalid action %r)Ú_parse_directiveÚ_include_patternr7ÚwarningÚ_exclude_patternr)rÚ directiveÚactionÚpatternsÚthedirÚ dirpatternÚpatterns rÚprocess_directivezManifest.process_directive„sÉ€ð04×/DÑ/DÀYÓ/OÑ,ˆ�˜& *ð �YÒ Û#�Ø×,Ñ,¨W¸TÐ,ÕBÜ—N‘NÐ#?ÀÕIñ$ð�yÒ Û#�Ø×%Ñ% g°dÐ%Õ;ñ$ðÐ'Ò 'Û#�Ø×,Ñ,¨W¸UÐ,ÕCÜ—N‘Nð$>Ø?FõHñ$ð Ð'Ò 'Û#�Ø×%Ñ% g°eÐ%Õ<ñ$ðÐ*Ò *Û#�Ø×,Ñ,¨W¸VÐ,ÕDÜ—N‘Nð$8Ø9@À&õJñ$ð Ð*Ò *Û#�Ø×%Ñ% g°fÐ%Õ=ñ$ð�wÒ Ø×(Ñ(¨°jÐ(ÔAÜ—‘ÐAØ)õ+ðBð�wÒ Ø×(Ñ(¨°jÐ(ÔAÜ—‘ð -Ø.8õ:ðBô #Ø# fÑ,ó.ð .rcó,—|j«}t|«dk(r|ddvr|jdd«|d}dx}x}}|dvr8t|«dkrtd|z«‚|ddD�cgc] }t |«‘Œ}}n‡|d vrFt|«d krtd |z«‚t |d«}|ddD�cgc] }t |«‘Œ}}n=|d vr+t|«dk7rtd |z«‚t |d«}ntd|z«‚||||fScc}wcc}w)zŸ Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rLrNrOrPrQrRrSrTrLN)rLrNrOrPrz$%r expects ...)rQrRéz*%r expects ...)rSrTz!%r expects a single zunknown action %r)r9ÚlenÚinsertrr)rrYÚwordsrZr[r\Ú dir_patternÚwords rrUzManifest._parse_directiveÈsh€ð —‘Ó!ˆÜ ˆu‹:˜Š?˜u Q™xð0Bñ Bð �L‰L˜˜IÔ &à�q‘ˆØ*.Ð.ˆÐ.�6˜Kà ð:ñ :ä�5‹z˜AŠ~Ü&Ø:¸VÑCóEðEð8=¸Q¸R±yÓA±y¨tœ  TÕ*°yˆHÑAà ÐAÑ AÜ�5‹z˜AŠ~Ü&Ø@À6ÑIóKðKô" %¨¡(Ó+ˆFØ7<¸Q¸R±yÓA±y¨tœ  TÕ*°yˆHÑAà Ð)Ñ )Ü�5‹z˜QŠÜ&Ø7¸&Ñ@óBðBô' u¨Q¡xÓ0‰Kô#Ð#6¸Ñ#?Ó@Ð @à�x ¨Ð4Ð4ùò)BùòBs Á*D Â4Dcóê—d}|j||||«}|j€|j«|jD]1}|j|«sŒ|jj |«d}Œ3|S)a…Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found. FT)Ú_translate_patternrr+Úsearchrr.)rr^rMrÚis_regexÚfoundÚ pattern_rer(s rrVzManifest._include_pattern÷sl€ð8ˆØ×,Ñ,¨W°f¸fÀhÓOˆ ð �=‰=Ð Ø �L‰LŒNà—M”MˆDØ× Ñ  Õ&Ø— ‘ —‘˜tÔ$Ø‘ð"ðˆ rcóÄ—d}|j||||«}t|j«D]1}|j|«sŒ|jj |«d}Œ3|S)atRemove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rhÚlistrriÚremove)rr^rMrrjrkrlrGs rrXzManifest._exclude_pattern s^€ðˆØ×,Ñ,¨W°f¸fÀhÓOˆ Ü�d—j‘jÖ!ˆAØ× Ñ  Õ#Ø— ‘ ×!Ñ! !Ô$Ø‘ð"ðˆ rcóJ—|r't|t«rtj|«S|StdkDr$|j d«j d«\}}}|r>|j |«}tdkDr&|j«r|j«sJ‚d}tjtjj|jd««} |��tdkr0|j d«} |j |«dt| « } nX|j |«} | j«r| j«sJ‚| t|«t| «t|«z } tj} tjdk(rd} tdkrd| z| j| d|zf«z}n[|t«t|«t«z }|›| ›| ›| ›d|›|›�}n(|r&tdkr d| z|z}n›| ›|t|«d›�}tj|«S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rarr=r5NÚ\z\\Ú^z.*)Ú isinstanceÚstrÚreÚcompileÚ_PYTHON_VERSIONÚ _glob_to_reÚ partitionr-ÚendswithÚescaper r r"rrbr) rr^rMrrjÚstartr=ÚendrlrÚ empty_patternÚ prefix_rers rrhzManifest._translate_pattern4sþ€ñ ܘ'¤3Ô'Ü—z‘z 'Ó*Ð*à�ä ˜VÒ #à ×,Ñ,¨SÓ1×;Ñ;¸CÓ@‰MˆE�1�cá Ø×)Ñ)¨'Ó2ˆJÜ Ò'Ø!×,Ñ,¨UÔ3¸ ×8KÑ8KÈCÔ8PÐPÐPàˆJä�y‰yœŸ™Ÿ™ d§i¡i°Ó4Ó5ˆØ Ñ ä &Ò(Ø $× 0Ñ 0°Ó 4� Ø ×,Ñ,¨VÓ4Ð5I´s¸=Ó7IÐ6IÐJ‘ à ×,Ñ,¨VÓ4� Ø ×+Ñ+¨EÔ2°y×7IÑ7IÈ#Ô7NÐNÐNØ%¤c¨%£j´#°i³.Ä3ÀsÃ8Ñ2KÐL� Ü—&‘&ˆCÜ�v‰v˜Š~Ø�Ü &Ò(Ø  4™Z¨#¯(©(°IØ48¸:Ñ4Eð4Gó+HñH‘ ð(¬¨E« ´C¸ ³OÄcÈ#ÃhÑ4NÐO� Ù27¹¹yÊ#Ù2<¹cðC‘ ñÜ" fÒ,Ø!$ t¡¨jÑ!8‘Já.3±T¸:ÄcÈ%ÃjÀkÑ;RÐ!S�Jä�z‰z˜*Ó%Ð%rcó²—tj|«}tj}tjdk(rd}d|z}t j d||«}|S)z÷Translate a shell-like glob pattern to a regular expression. Return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). rqz\\\\z\1[^%s]z((?ðˆCؘsÑ"ˆÜ—V‘VÐ1°7¸JÓGˆ ØÐrr@)F)TNF)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr+r.r2rDrJr_rUrVrXrhrx©rrrr&sc„ñó ò#ò6/òó@ò,ò >.òH-5ð^=AØ"'ó'ðR=AØ"'óð(?CØ$)ó5&ónr)rˆr�Úloggingr ruÚsysr5rÚcompatrÚutilrÚ__all__Ú getLoggerr…r7rvÚMÚ_COLLAPSE_PATTERNÚSÚ_COMMENTED_LINEÚ version_inforwÚobjectrr‰rrÚr–s™ðñ ó ÛÛ Û Û åÝÝð ˆ,€à ˆ× Ñ ˜8Ó $€ð�B—J‘J˜z¨2¯4©4Ó0ÐØ�"—*‘*Ð1°2·4±4¸"¿$¹$±;Ó?€ð×"Ñ" 2 AÐ&€ôZˆvõZr