Ë
    ¦#ijb>  ã                   ó†   — d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZmZ d dlmZ d d	lmZ  G d
„ de«      Zy)é    N)Úapps)Úget_finders)Ústaticfiles_storage)ÚTags)ÚFileSystemStorage)ÚBaseCommandÚCommandError)Úno_style)Úcached_propertyc                   óŽ   ‡ — e Zd ZdZdZej                  gZˆ fd„Ze	d„ «       Z
d„ Zd„ Zd„ Zd„ Zdd	„Zd
„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚCommandzc
    Copies or symlinks static files from different locations to the
    settings.STATIC_ROOT.
    z*Collect static files in a single location.c                 ó¬   •— t        ‰| �  |i |¤Ž g | _        g | _        g | _        g | _        g | _        g | _        t        | _	        t        «       | _        y ©N)ÚsuperÚ__init__Úcopied_filesÚsymlinked_filesÚunmodified_filesÚpost_processed_filesÚskipped_filesÚdeleted_filesr   Ústorager
   Ústyle)ÚselfÚargsÚkwargsÚ	__class__s      €úv/var/www/html/office/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.pyr   zCommand.__init__   sU   ø€ Ü‰Ñ˜$Ð) &Ò)ØˆÔØ!ˆÔØ "ˆÔØ$&ˆÔ!ØˆÔØˆÔÜ*ˆŒÜ“Zˆ�
ó    c                 óZ   — 	 | j                   j                  d«       y# t        $ r Y yw xY w)NÚ FT)r   ÚpathÚNotImplementedError©r   s    r   ÚlocalzCommand.local!   s2   € ð	Ø�L‰L×Ñ˜bÔ!ð øô #ò 	Ùð	ús   ‚ ž	*©*c           	      ó2  — |j                  ddddd¬«       |j                  dddd	¬«       |j                  d
ddg ddd¬«       |j                  dddd¬«       |j                  dddd¬«       |j                  dddd¬«       |j                  dddd¬«       y )Nz	--noinputz
--no-inputÚstore_falseÚinteractivez-Do NOT prompt the user for input of any kind.)ÚactionÚdestÚhelpz--no-post-processÚpost_processz$Do NOT post process collected files.z-iz--ignoreÚappendÚignore_patternsÚPATTERNz`Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.)r)   Údefaultr*   Úmetavarr+   z-nz	--dry-runÚ
store_truez+Do everything except modify the filesystem.)r)   r+   z-cz--clearz[Clear the existing files using the storage before trying to copy or link the original file.z-lz--linkz7Create a symbolic link to each file instead of copying.z--no-default-ignoreÚuse_default_ignore_patternszWDon't ignore the common private glob-style patterns (defaults to 'CVS', '.*' and '*~').)Úadd_argument)r   Úparsers     r   Úadd_argumentszCommand.add_arguments)   sù   € Ø×ÑØØØ ØØ@ð 	ô 	
ð 	×ÑØØ ØØ7ð	 	ô 	
ð 	×ÑØØØØØ"Øð:ð 	ô 		
ð 	×ÑØØØØ>ð	 	ô 	
ð 	×ÑØØØð?ð	 	ô 	
ð 	×ÑØØØØJð	 	ô 	
ð 	×ÑØ!Ø Ø.ð)ð 	õ 	
r   c                 óT  — |d   | _         |d   | _        |d   | _        |d   | _        |d   | _        |d   }|d   r"|t        j                  d«      j                  z  }t        |D �ch c]!  }t        j                  j                  |«      ’Œ# c}«      | _        |d	   | _        y
c c}w )zA
        Set instance variables based on an options dict
        r(   Ú	verbosityÚlinkÚclearÚdry_runr.   r3   Ústaticfilesr,   N)r(   r8   Úsymlinkr:   r;   r   Úget_app_configr.   ÚlistÚosr"   Únormpathr,   )r   Úoptionsr.   Úps       r   Úset_optionszCommand.set_options^   s©   € ð # =Ñ1ˆÔØ  Ñ-ˆŒØ˜v‘ˆŒØ˜WÑ%ˆŒ
Ø˜yÑ)ˆŒØ!Ð"3Ñ4ˆØÐ0Ò1Øœt×2Ñ2°=ÓA×QÑQÑQˆOÜ#À/Ö$R¸Q¤R§W¡W×%5Ñ%5°aÕ%8Ò$RÓSˆÔØ# NÑ3ˆÕùò %Ss   Á(&B%c                 ó˜  — | j                   r| j                  st        d«      ‚| j                  r| j	                  d«       | j                   r| j
                  }n| j                  }i }t        «       D ]¦  }|j                  | j                  «      D ]†  \  }}t        |dd«      r+t        j                  j                  |j                  |«      }n|}||vr||f||<    ||||«       ŒV| j                  j!                  |«       | j#                  d|z  d¬«       Œˆ Œ¨ | j$                  rÞt'        | j(                  d«      rÈ| j(                  j%                  || j*                  ¬	«      }|D ]œ  \  }}	}
t-        |
t.        «      r:| j0                  j3                  d
|z  «       | j0                  j3                  «        |
‚|
r6| j#                  d|›d|	›d�d¬«       | j4                  j!                  |«       Œ‰| j#                  d|z  «       Œž | j6                  | j8                  z   | j:                  | j4                  | j                  | j<                  dœS )zx
        Perform the bulk of the work of collectstatic.

        Split off from handle() to facilitate testing.
        z&Can't symlink to a remote destination.r!   ÚprefixNzÆFound another file with the destination path '%s'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.é   ©Úlevelr,   )r;   zPost-processing '%s' failed!zPost-processed 'z' as 'ú'zSkipped post-processing '%s')ÚmodifiedÚ
unmodifiedÚpost_processedÚskippedÚdeleted)r=   r%   r	   r:   Ú	clear_dirÚ	link_fileÚ	copy_filer   r?   r.   Úgetattrr@   r"   ÚjoinrF   r   r-   Úlogr,   Úhasattrr   r;   Ú
isinstanceÚ	ExceptionÚstderrÚwriter   r   r   r   r   )r   ÚhandlerÚfound_filesÚfinderr"   r   Úprefixed_pathÚ	processorÚoriginal_pathÚprocessed_pathÚ	processeds              r   ÚcollectzCommand.collectm   s  € ð �<Š< §
¢
ÜÐGÓHÐHà�:Š:Ø�N‰N˜2Ôà�<Š<Ø—n‘n‰Gà—n‘nˆGàˆÜ!“mò 	ˆFØ!'§¡¨T×-AÑ-AÓ!Bò ‘��gä˜7 H¨dÔ3Ü$&§G¡G§L¡L°·±ÀÓ$F‘Mà$(�Mà ¨Ñ3Ø29¸4°�K Ñ.Ù˜D -°Õ9à×&Ñ&×-Ñ-¨mÔ<Ø—H‘Hð?ð BOñOð  ð õ ñð	ð, ×Ò¤¨¯©°~Ô!FØŸ™×1Ñ1°+ÀtÇ|Á|Ð1ÓTˆIØ<Eò MÑ8�˜~¨yÜ˜i¬Ô3Ø—K‘K×%Ñ%Ð&DÀ}Ñ&TÔUð —K‘K×%Ñ%Ô'Ø#�OÙØ—H’HÚ9FÊÐWØð ô ð ×-Ñ-×4Ñ4°]ÕCà—H‘HÐ;¸mÑKÕLðMð" ×)Ñ)¨D×,@Ñ,@Ñ@Ø×/Ñ/Ø"×7Ñ7Ø×)Ñ)Ø×)Ñ)ñ
ð 	
r   c           
      ó\  —  | j                   d i |¤Ž dg}| j                  r|j                  d«       |j                  d«       | j                  «       r‚| j                  j
                  rl| j                  j
                  }|j                  d|z  «       | j                  j                  |«      xr$ t        | j                  j                  |«      «      }nd }|j                  d«       d}| j                  rj|rh| j                  r|j                  d«       n|j                  d«       |j                  d	«       t        d
j                  |«      «      dk7  rt        d«      ‚| j                  «       }| j                  dk\  r­t!        |d   «      }t!        |d   «      }t!        |d   «      }t!        |d   «      }	t!        |d   «      }
d|dkD  r|›d|dk(  rd
nd›d�nd
|d|dk(  rd
ndz   | j"                  rdnd|rd|z  nd
|d   rd|z  nd
|d   xr d|	z  xs d
|d   r	d|
z  dœz  S d
dœz  S y )!Nú
zGYou have activated the --dry-run option so no files will be modified.

zdYou have requested to collect static files at the destination
location as specified in your settingsz:

    %s

z.

Tz-This will DELETE ALL FILES in this location!
z$This will overwrite existing files!
zNAre you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: r!   Úyesz"Collecting static files cancelled.é   rO   rK   rL   rM   rN   zs
%(deleted)s%(modified_count)s %(identifier)s %(action)s%(destination)s%(unmodified)s%(post_processed)s%(skipped)s.r   z static fileÚsz
 deleted, zstatic fileÚ	symlinkedÚcopiedz to '%s'z, %s unmodifiedz, %s post-processedz, %s skipped due to conflict)rO   Úmodified_countÚ
identifierr)   ÚdestinationrL   rM   rN   © )rD   r;   r-   Úis_local_storager   ÚlocationÚexistsÚanyÚlistdirr(   r:   ÚinputrT   r	   rc   r8   Úlenr=   )r   rB   ÚmessageÚdestination_pathÚshould_warn_userÚ	collectedÚdeleted_countrk   Úunmodified_countÚpost_processed_countÚskipped_counts              r   ÚhandlezCommand.handle¯   sk  € Øˆ×ÑÑ#˜7Ò#Ø�&ˆØ�<Š<Ø�N‰Nð ôð
 	�‰ð5ô	
ð
 × Ñ Ô" t§|¡|×'<Ò'<Ø#Ÿ|™|×4Ñ4ÐØ�N‰NÐ,Ð/?Ñ?Ô@Ø#Ÿ|™|×2Ñ2Ð3CÓDò  ÌØ—‘×$Ñ$Ð%5Ó6óJÑð  $ÐØ�N‰N˜7Ô#à#Ðà×ÒÑ 0Ø�zŠzØ—‘ÐOÕPà—‘ÐFÔGà�N‰Nð>ôô �R—W‘W˜WÓ%Ó&¨%Ò/Ü"Ð#GÓHÐHà—L‘L“Nˆ	à�>‰>˜QÒÜ 	¨)Ñ 4Ó5ˆMÜ  ¨:Ñ!6Ó7ˆNÜ" 9¨\Ñ#:Ó;ÐÜ#& yÐ1AÑ'BÓ#CÐ Ü 	¨)Ñ 4Ó5ˆMðNð % qÒ(ò %¨M¸QÒ,>¡bÀCÑ&GñIð à"0Ø+°^ÀqÒ5H©rÈcÑRØ)-¯ª™+¸8á5E�JÐ!1Ò1È2ð ! Ò.ð &Ð(8Ò8àð Ð.Ñ/ò EØ-Ð0DÑDòàð ! Ò+ð 3°]ÑBñ1ñð ð: ñ5ñð ð r   c                 óZ   — | j                   |k\  r| j                  j                  |«       yy)z"
        Small log helper
        N)r8   ÚstdoutrZ   )r   ÚmsgrI   s      r   rU   zCommand.logÿ   s'   € ð �>‰>˜UÒ"Ø�K‰K×Ñ˜cÕ"ð #r   c                 ó6   — t        | j                  t        «      S r   )rW   r   r   r$   s    r   ro   zCommand.is_local_storage  s   € Ü˜$Ÿ,™,Ô(9Ó:Ð:r   c                 ó‚  — | j                   j                  |«      sy| j                   j                  |«      \  }}|D �]  }t        j                  j                  ||«      }| j                  r2| j                  d|z  d¬«       | j                  j                  |«       Œb| j                  d|z  d¬«       | j                  j                  |«       	 | j                   j	                  |«      }t        j                  j                  |«      s6t        j                  j                  |«      rt        j                  |«       �Œ| j                   j                  |«       �Œ! |D ]1  }| j                  t        j                  j                  ||«      «       Œ3 y# t        $ r | j                   j                  |«       Y �Œ€w xY w)zW
        Delete the given relative path using the destination storage backend.
        NúPretending to delete '%s'rG   rH   úDeleting '%s')r   rq   rs   r@   r"   rT   r;   rU   r   r-   ÚlexistsÚunlinkÚdeleter#   rP   )r   r"   ÚdirsÚfilesÚfÚfpathÚ	full_pathÚds           r   rP   zCommand.clear_dir	  sU  € ð �|‰|×"Ñ" 4Ô(Øà—l‘l×*Ñ*¨4Ó0‰ˆˆeØó 	3ˆAÜ—G‘G—L‘L  qÓ)ˆEØ�|Š|Ø—‘Ð4°uÑ<ÀA�ÔFØ×"Ñ"×)Ñ)¨%Õ0à—‘˜¨5Ñ0¸�Ô:Ø×"Ñ"×)Ñ)¨%Ô0ð	3Ø $§¡× 1Ñ 1°%Ó 8�Iô Ÿ7™7Ÿ>™>¨)Ô4¼¿¹¿¹ÈÔ9SäŸ	™	 )Ö,àŸ™×+Ñ+¨EÖ2ð#	3ð$ ò 	2ˆAØ�N‰Nœ2Ÿ7™7Ÿ<™<¨¨aÓ0Õ1ñ	2øô +ò /Ø—L‘L×'Ñ'¨×.ð/ús   ÃFÆ$F>Æ=F>c                 ó  — | j                   j                  |«      �r<	 | j                   j                  |«      }	 |j                  |«      }| j                  rI| j                   j	                  |«      }| j
                  t        j                  j                  |«      z   }nd}|j                  d¬«      |j                  d¬«      k\  }|r@|r>|| j                  vr| j                  j                  |«       | j                  d|z  «       y| j                  r| j                  d|z  «       y| j                  d|z  «       | j                   j                  |«       y# t        t        f$ r Y Œbw xY w# t        t        f$ r Y Œww xY w)zR
        Check if the target file should be deleted if it already exists.
        Tr   )ÚmicrosecondzSkipping '%s' (not modified)Fr„   r…   )r   rq   Úget_modified_timer%   r"   r=   r@   ÚislinkÚreplacer   r-   rU   ÚOSErrorr#   r;   rˆ   )	r   r"   r^   Úsource_storageÚtarget_last_modifiedÚsource_last_modifiedr�   Úcan_skip_unmodified_filesÚfile_is_unmodifieds	            r   Údelete_filezCommand.delete_file&  sx  € ð �<‰<×Ñ˜}Õ-ð%%à'+§|¡|×'EÑ'EÀmÓ'TÐ$ð
%à+9×+KÑ+KÈDÓ+QÐ(ð
 —z’zØ$(§L¡L×$5Ñ$5°mÓ$D˜	ð !ŸL™L¬2¯7©7¯>©>¸)Ó+DÑDð5Ñ1ð 59Ð1à)=×)EÑ)EØ$%ð *Fó *à-×5Ñ5À!Ð5ÓDñ*EÐ&ñ *Ñ.GØ(°×0EÑ0EÑEØ ×1Ñ1×8Ñ8¸ÔGØŸ™Ð!?À$Ñ!FÔGØ$à�|Š|Ø—‘Ð4°tÑ;Ô<ð ð —‘˜¨4Ñ/Ô0Ø—‘×#Ñ# MÔ2ØøôE  Ô!4Ð5ò Ùðûô Ô0Ð1ò áðús"   žE/ ºE ÅE,Å+E,Å/FÆ Fc                 ó  — || j                   v r| j                  d|z  «      S | j                  |||«      sy|j                  |«      }| j                  r| j                  d|z  d¬«       n°| j                  d|z  d¬«       | j
                  j                  |«      }t        j                  t        j                  j                  |«      d¬	«       	 t        j                  j                  |«      rt        j                  |«       t        j                  ||«       || j                   vr| j                   j!                  |«       yy# t        $ r! d
dl}t        d|j                  «       z  «      ‚t        $ r}t        |«      ‚d}~ww xY w)z*
        Attempt to link ``path``
        z&Skipping '%s' (already linked earlier)NzPretending to link '%s'rg   rH   zLinking '%s'rG   T)Úexist_okr   z2Symlinking is not supported in this platform (%s).)r   rU   rš   r"   r;   r   r@   ÚmakedirsÚdirnamer†   r‡   r=   r#   Úplatformr	   r”   r-   )r   r"   r^   r•   Úsource_pathr�   rŸ   Úes           r   rQ   zCommand.link_fileY  sQ  € ð
 ˜D×0Ñ0Ñ0Ø—8‘8ÐDÀtÑKÓLÐLà×Ñ  m°^ÔDØà$×)Ñ)¨$Ó/ˆà�<Š<Ø�H‰HÐ.°Ñ<ÀAˆHÕFà�H‰H�^ kÑ1¸ˆHÔ;ØŸ™×)Ñ)¨-Ó8ˆIÜ�K‰KœŸ™Ÿ™¨	Ó2¸TÕBð&Ü—7‘7—?‘? 9Ô-Ü—I‘I˜iÔ(Ü—
‘
˜;¨	Ô2ð  × 4Ñ 4Ñ4Ø× Ñ ×'Ñ'¨Õ6ð 5øô 'ò Ûä"ð%Ø'/×'8Ñ'8Ó':ñ;óð ô ò &Ü" 1“oÐ%ûð&ús   ÃA
E Å1FÅ7FÆFc                 ó¾  — || j                   v r| j                  d|z  «      S | j                  |||«      sy|j                  |«      }| j                  r| j                  d|z  d¬«       nL| j                  d|z  d¬«       |j                  |«      5 }| j                  j                  ||«       ddd«       | j                   j                  |«       y# 1 sw Y   Œ%xY w)z7
        Attempt to copy ``path`` with storage
        z&Skipping '%s' (already copied earlier)NzPretending to copy '%s'rg   rH   zCopying '%s'rG   )	r   rU   rš   r"   r;   Úopenr   Úsaver-   )r   r"   r^   r•   r    Úsource_files         r   rR   zCommand.copy_file|  sË   € ð
 ˜D×-Ñ-Ñ-Ø—8‘8ÐDÀtÑKÓLÐLà×Ñ  m°^ÔDØà$×)Ñ)¨$Ó/ˆà�<Š<Ø�H‰HÐ.°Ñ<ÀAˆHÕFà�H‰H�^ kÑ1¸ˆHÔ;Ø×$Ñ$ TÓ*ð >¨kØ—‘×!Ñ! -°Ô=÷>à×Ñ× Ñ  Õ/÷>ð >ús   ÂCÃC)rG   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r+   r   r<   Úrequires_system_checksr   r   r%   r6   rD   rc   r~   rU   ro   rP   rš   rQ   rR   Ú__classcell__)r   s   @r   r   r      sp   ø„ ñð
 8€DØ"×.Ñ.Ð/Ðô	 ð ñó ðò3
òj4ò@
òDNó`#ò;ò2ò:1òf!7öF0r   r   )r@   Údjango.appsr   Ú"django.contrib.staticfiles.findersr   Ú"django.contrib.staticfiles.storager   Údjango.core.checksr   Údjango.core.files.storager   Údjango.core.management.baser   r	   Údjango.core.management.colorr
   Údjango.utils.functionalr   r   rn   r   r   ú<module>r´      s.   ðÛ 	å Ý :Ý BÝ #Ý 7ß AÝ 1Ý 3ôB0ˆkõ B0r   