ó
    EñiÐ  ã                   óh  • S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
Jr   " S S\5      r\" 5       R                  r\R                   \SS	\R"                  S
S4S jj5       5       r\R&                  S	\4S j5       r\R&                  SS j5       rSS jr     SS jrS rS rSS jrS rg)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.é    Né   )Ú	file_util)Úlog)ÚDistutilsFileErrorÚDistutilsInternalErrorc                   óB   ^ • \ rS rSrSrS r\U 4S j5       rS rSr	U =r
$ )ÚSkipRepeatAbsolutePathsé   z†
Cache for mkpath.

In addition to cheapening redundant calls, eliminates redundant
"creating /foo/bar/baz" messages in dry-run mode.
c                 ó   • U [         l        g ©N)r	   Úinstance)Úselfs    Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/setuptools/_distutils/dir_util.pyÚ__init__Ú SkipRepeatAbsolutePaths.__init__   s   € Ø+/ÔÕ(ó    c                 ó4   >• [         X R                  ]  5         g r   )Úsuperr   Úclear)ÚclsÚ	__class__s    €r   r   ÚSkipRepeatAbsolutePaths.clear   s   ø€ äˆc—<‘<Ñ&Õ(r   c                 óJ   ^ ^• [         R                  " T5      UU 4S j5       nU$ )Nc                 óˆ   >• U R                  5       T;   a  g T" U /UQ70 UD6nTR                  U R                  5       5        U$ r   )ÚabsoluteÚadd)ÚpathÚargsÚkwargsÚresultÚfuncr   s       €€r   ÚwrapperÚ-SkipRepeatAbsolutePaths.wrap.<locals>.wrapper   s?   ø€ à�}‰}‹ $Ó&ØÙ˜$Ð0 Ò0¨Ñ0ˆFØ�H‰H�T—]‘]“_Ô%ØˆMr   )Ú	functoolsÚwraps)r   r!   r"   s   `` r   ÚwrapÚSkipRepeatAbsolutePaths.wrap   s%   ù€ Ü	�Š˜Ó	õ	ó 
ð	ð ˆr   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úclassmethodr   r&   Ú__static_attributes__Ú__classcell__)r   s   @r   r	   r	      s+   ø† ñò0ð ô)ó ð)÷	ð 	r   r	   ÚnameÚreturnc                 óî   • U(       a,  U R                  5       (       d  [        R                  " SU 5         U R                  USSS9  g! [         a#  n[        SU  SUR                  S    35      eSnAff = f)aˆ  Create a directory and any missing ancestor directories.

If the directory already exists (or if 'name' is the empty string, which
means the current directory, which of course exists), then do nothing.
Raise DistutilsFileError if unable to create some directory along the way
(eg. some sub-path exists, but is a file rather than a directory).
If 'verbose' is true, log the directory created.
zcreating %sT)ÚmodeÚparentsÚexist_okzcould not create 'ú': éÿÿÿÿN)Úis_dirr   ÚinfoÚmkdirÚOSErrorr   r   )r1   r4   ÚverboseÚexcs       r   Úmkpathr?   .   sj   € ö �t—{‘{—}‘}Ü�Š� Ô%ðOØ�
‰
˜ d°Tˆ
Ò:øÜó OÜ Ð#5°d°V¸3¸s¿x¹xÈ¹|¸nÐ!MÓNÐNûðOús   µA Á
A4ÁA/Á/A4c                 óH   • [        [        R                  " U 5      /UQ70 UD6$ r   )r?   ÚpathlibÚPath©r1   r   r   s      r   Ú_rD   B   s    € ä”'—,’,˜tÓ$Ð6 tÒ6¨vÑ6Ð6r   c                 ó"   • [        SU < S35      e)z&
Detect a common bug -- name is None.
z%mkpath: 'name' must be a string (got Ú))r   rC   s      r   rD   rD   G   s   € ô
 !Ð#HÈÉÐPQÐ!RÓ
SÐSr   c                 óh   ^ • [        U 4S jU 5       5      n[        U5       H  n[        XRUS9  M     g)a†  Create all the empty directories under 'base_dir' needed to put 'files'
there.

'base_dir' is just the name of a directory which doesn't necessarily
exist yet; 'files' is a list of filenames to be interpreted relative to
'base_dir'.  'base_dir' + the directory portion of every file in 'files'
will be created if it doesn't already exist.  'mode' and 'verbose'
flags are as for 'mkpath()'.
c              3   óž   >#   • U  HB  n[         R                  R                  T[         R                  R                  U5      5      v •  MD     g 7fr   )Úosr   ÚjoinÚdirname)Ú.0ÚfileÚbase_dirs     €r   Ú	<genexpr>Úcreate_tree.<locals>.<genexpr>Z   s0   øé € ÐSÊUÀT”2—7‘7—<‘< ¬"¯'©'¯/©/¸$Ó*?×@Ð@ÊUùs   ƒA
A©r=   N)ÚsetÚsortedr?   )rN   Úfilesr4   r=   Úneed_dirÚdirs   `     r   Úcreate_treerW   O   s0   ø€ ô ÔSÉUÓSÓS€Hô �hÖˆÜˆs 'Ô*ò  r   c                 ó¢  • [         R                  R                  U 5      (       d  [        SU  S35      e [         R                  " U 5      n[        XS9  [        R                  " [        U UUUUUUS9n	[        [        R                  R                  [        X—5      5      5      $ ! [
         a   n[        SU  SUR                   35      eSnAff = f)a»  Copy an entire directory tree 'src' to a new location 'dst'.

Both 'src' and 'dst' must be directory names.  If 'src' is not a
directory, raise DistutilsFileError.  If 'dst' does not exist, it is
created with 'mkpath()'.  The end result of the copy is that every
file in 'src' is copied to 'dst', and directories under 'src' are
recursively copied to 'dst'.  Return the list of files that were
copied or might have been copied, using their output name.  The
return value is unaffected by 'update': it is simply
the list of all files under 'src', with the names changed to be
under 'dst'.

'preserve_mode' and 'preserve_times' are the same as for
'copy_file'; note that they only apply to regular files, not to
directories.  If 'preserve_symlinks' is true, symlinks will be
copied as symlinks (on platforms that support them!); otherwise
(the default), the destination of the symlink will be copied.
'update' and 'verbose' are the same as for 'copy_file'.
zcannot copy tree 'z': not a directoryzerror listing files in 'r7   NrQ   )ÚsrcÚdstÚpreserve_symlinksr=   Úpreserve_modeÚpreserve_timesÚupdate)rI   r   Úisdirr   Úlistdirr<   Ústrerrorr?   r$   ÚpartialÚ	_copy_oneÚlistÚ	itertoolsÚchainÚfrom_iterableÚmap)
rY   rZ   r\   r]   r[   r^   r=   ÚnamesÚeÚcopy_ones
             r   Ú	copy_treerl   a   sÄ   € ô8 �7‰7�=‰=˜×ÑÜ Ð#5°c°UÐ:LÐ!MÓNÐNðRÜ—
’
˜3“ˆô ˆ3Ò ä× Ò ÜØØØ+ØØ#Ø%Øñ	€Hô ”	—‘×-Ñ-¬c°(Ó.BÓCÓDÐDøô ó RÜ Ð#;¸C¸5ÀÀAÇJÁJÀ<Ð!PÓQÐQûðRús   µB$ Â$
CÂ.C	Ã	Cc          
   #   ó^  #   • [         R                  R                  X5      n[         R                  R                  X 5      n	U R                  S5      (       a  g U(       ar  [         R                  R	                  U5      (       aN  [         R
                  " U5      n
US:¼  a  [        R                  " SXš5        [         R                  " X©5        U	v •  g [         R                  R                  U5      (       a  [        UU	UUUUUS9 S h  v•N   g [        R                  " UU	UUUUS9  U	v •  g  N#7f)Nz.nfsr   zlinking %s -> %srQ   )rI   r   rJ   Ú
startswithÚislinkÚreadlinkr   r:   Úsymlinkr_   rl   r   Ú	copy_file)r1   rY   rZ   r[   r=   r\   r]   r^   Úsrc_nameÚdst_nameÚ	link_dests              r   rc   rc   “   sï   é € ô �w‰w�|‰|˜CÓ&€HÜ�w‰w�|‰|˜CÓ&€Hà‡��v×ÑàæœRŸW™WŸ^™^¨H×5Ñ5Ü—K’K Ó)ˆ	Ø�a‹<Ü�HŠHÐ'¨Ô=Ü
�
Š
�9Ô'Ø‹ä	�‰�‰�x×	 Ñ	 ÜØØØØØØØñ
÷ 	
ñ 	
ô 	×ÒØØØØØØò	
ð ‹ñ%	
ùs   ‚DD-ÄD+Ä$D-c                 óª  • [         R                  " U 5       H˜  n[         R                  R                  X5      n[         R                  R	                  U5      (       a1  [         R                  R                  U5      (       d  [        X15        Mw  UR                  [         R                  U45        Mš     UR                  [         R                  U 45        g)zHelper for remove_tree().N)
rI   r`   r   rJ   r_   ro   Ú_build_cmdtupleÚappendÚremoveÚrmdir)r   Ú	cmdtuplesÚfÚreal_fs       r   rw   rw   Â   s„   € ä�ZŠZ˜ÖˆÜ—‘—‘˜dÓ&ˆÜ�7‰7�=‰=˜× Ñ ¬¯©¯©¸×)?Ñ)?Ü˜FÖ.à×ÑœbŸi™i¨Ð0Ö1ñ ð ×Ñ”b—h‘h Ð%Õ&r   c                 ó  • US:¼  a  [         R                  " SU 5        / n[        X5        U H&  n US   " US   5        [        R	                  5         M(     g! [
         a"  n[         R                  " SX5         SnAMR  SnAff = f)z�Recursively remove an entire directory tree.

Any errors are ignored (apart from being reported to stdout if 'verbose'
is true).
r   z'removing '%s' (and everything under it)r   zerror removing %s: %sN)r   r:   rw   r	   r   r<   Úwarning)Ú	directoryr=   r{   Úcmdr>   s        r   Úremove_treer‚   Í   sx   € ð �!ƒ|Ü�ŠÐ:¸IÔFØ€IÜ�IÔ)Ûˆð	AØ�ŠF�3�q‘6ŒNä#×)Ñ)Ö+ò	 øô
 ó 	AÜ�KŠKÐ/°×@Ò@ûð	Aús   ±"AÁ
BÁ"A?Á?Bc                 ó„   • [         R                  R                  U 5      u  pU SS [         R                  :X  a  XSS -   n U $ )z~Take the full path 'path', and make it a relative path.

This is useful to make 'path' the second argument to os.path.join().
r   r   N)rI   r   Ú
splitdriveÚsep)r   Údrives     r   Úensure_relativer‡   à   s?   € ô
 —'‘'×$Ñ$ TÓ*�K€EØˆAˆa€y”B—F‘FÓØ˜A˜B�xÑˆØ€Kr   )iÿ  T)r1   N)TTFFT)T)r-   r$   re   rI   rA   Ú r   Ú_logr   Úerrorsr   r   rR   r	   r&   r"   ÚsingledispatchrB   r?   ÚregisterÚstrrD   rW   rl   rc   rw   r‚   r‡   r(   r   r   Ú<module>rŽ      sâ   ðñGó Û Û 	Û å Ý ß >ô˜cô ñ8 "Ó
#×
(Ñ
(€ð ×ÑØñO�—‘ð O¸Dô Oó 	ó ðOð$ ‡�ð7ˆCó 7ó ð7ð ‡�óTó ðTô+ð* ØØØØô/Eòd,ò^'ôAó&r   