\hX7@dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ejeZej dej"Zej d ej"ej&zZej*dd ZGd deZy) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode) convert_pathManifestz\\w* z#.*?(?= )| (?=$)cneZdZdZddZdZdZdZddZdZ d Z d Z dd Z dd Z dd ZdZy)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) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrs _/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_vendor/distlib/manifest.py__init__zManifest.__init__,sV GGOOBGG$4$4T5HRYY[$IJ ii"&&(  U cddlm}m}m}gx|_}|j }|g}|j }|j}|r|}tj|} | D]} tjj|| } tj| } | j} || r|jt| g|| sp|| ry|| |ryy)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermodes rfindallzManifest.findall;s 32#%% yyii||5DJJt$E #77<<d3wwx(||4=OOHX$67T]74=N # rc|j|js*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"rraddr)ritems rr.z Manifest.addVsK t{{+77<< 40D rww''-.rc4|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.)ritemsr/s radd_manyzManifest.add_many`s  D HHTN rc6fdtj}|rz Manifest.sorted..add_dirns[ HHQK LL+Q /DII~GGMM!, Y...f%rc3ZK|]#}tjj|%ywN)r r r9).0r s r z"Manifest.sorted..}s>trww}}T*>s)+)rrr r dirnamesortedr")rwantdirsresultr:f path_tupler>s` @rrDzManifest.sortedis  &TZZ 5D 2bggooa01 2 dNF>v>>@j j)@ @@s0#Bc0t|_g|_y)zClear all collected files.N)rrr)rs rclearzManifest.clearsU  rc|j|\}}}}|dk(r2|D],}|j|drtjd|.y|dk(r|D]}|j |dy|dk(r2|D],}|j|drtjd|.y|d k(r|D]}|j |dy|d k(r3|D]-}|j|| rtjd ||/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 %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr7warning_exclude_patternr)r directiveactionpatternsthedir dirpatternpatterns rprocess_directivezManifest.process_directives04/D/DY/O,&* Y # J,,WT,BNN#?I Jy # <%%gd%; <' '# H,,WU,CNN$>?FH H ' '# =%%ge%< =* *# J,,WV,DNN$89@&J J * *# >%%gf%= >w ((j(AA)+Bw ((j(A -.8:B ##f,. .rc,|j}t|dk(r|ddvr|jdd|d}dx}x}}|dvr8t|dkrtd|z|ddDcgc] }t |}}n|d vrFt|d krtd |zt |d}|ddDcgc] }t |}}n=|d vr+t|dk7rtd |zt |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 ...)rQrRz*%r expects ...)rSrTz!%r expects a single zunknown action %r)r9leninsertrr)rrYwordsrZr[r\ dir_patternwords rrUzManifest._parse_directivesf ! u:?uQx0B B LLI &q*...6K : :5zA~&:VCEE8=QRyAt T*AHA A A5zA~&@6IKK"%(+F7|j |}tdkDr&|jr|jsJd}tjtjj|jd} |tdkr0|j d} |j |dt|  } nX|j |} | jr| jsJ| t|t| t|z } tj} tjdk(rd} tdkrd| z| j| d|zfz}n[|tt|tz }|| | | 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.*) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr-endswithescaper r r"rrbr) rr^rMrrjstartr=endrlr empty_pattern prefix_rers rrhzManifest._translate_pattern4s '3'zz'** V # ,,S1;;C@ME1c ))'2J'!,,U3 8K8KC8PPPJyydii45  &( $ 0 0 4  ,,V45Is=7I6IJ  ,,V4  ++E2y7I7I#7NNN%c%j#i.3s82KL &&Cvv~&( 4Z#((I48:4E4G+HH (E C Oc#h4NO 27y#2Cs"VV17JG rr@)F)TNF)__name__ __module__ __qualname____doc__rr+r.r2rDrJr_rUrVrXrhrxrrrr&sc #6/@, >.H-5^=A"''R=A"'(?C$)5&nr)rrloggingr rusysr5rcompatrutilr__all__ getLoggerrr7rvM_COLLAPSE_PATTERNS_COMMENTED_LINE version_inforwobjectrrrrrs    ,   8 $BJJz2440"**1244"$$;?""2A&ZvZr