§
    Ÿj;  ã                   óŽ   — 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dS )é    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          ¦   «         j        |i |¤Ž g | _        g | _        g | _        g | _        t          | _        t          ¦   «         | _	        d S ©N)
ÚsuperÚ__init__Úcopied_filesÚsymlinked_filesÚunmodified_filesÚpost_processed_filesr   Ústorager
   Ústyle)ÚselfÚargsÚkwargsÚ	__class__s      €ú‰/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/django/contrib/staticfiles/management/commands/collectstatic.pyr   zCommand.__init__   sU   ø€ Ø�‰ŒÔ˜$Ð) &Ð)Ð)Ð)ØˆÔØ!ˆÔØ "ˆÔØ$&ˆÔ!Ý*ˆŒÝ‘Z”ZˆŒ
ˆ
ˆ
ó    c                 ó`   — 	 | j                              d¦  «         n# t          $ r Y dS w xY wdS )NÚ FT)r   ÚpathÚNotImplementedError©r   s    r   ÚlocalzCommand.local   sG   € ð	ØŒL×Ò˜bÑ!Ô!Ð!Ð!øÝ"ð 	ð 	ð 	Ø�5�5ð	øøøàˆts   ‚ �
+ª+c           	      ól  — |                      ddddd¬¦  «         |                      dddd	¬¦  «         |                      d
ddg ddd¬¦  «         |                      dddd¬¦  «         |                      dddd¬¦  «         |                      dddd¬¦  «         |                      dddd¬¦  «         d S )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'   sI  € Ø×ÒØØØ ØØ@ð 	ñ 	
ô 	
ð 	
ð 	×ÒØØ ØØ7ð	 	ñ 	
ô 	
ð 	
ð 	×ÒØØØØØ"Øð:ð 	ñ 		
ô 		
ð 		
ð 	×ÒØØØØ>ð	 	ñ 	
ô 	
ð 	
ð 	×ÒØØØð?ð	 	ñ 	
ô 	
ð 	
ð 	×ÒØØØØJð	 	ñ 	
ô 	
ð 	
ð 	×ÒØ!Ø Ø.ð)ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
r   c                 ó6  — |d         | _         |d         | _        |d         | _        |d         | _        |d         | _        |d         }|d         r|t          j        d¦  «        j        z  }t          d	„ |D ¦   «         ¦  «        | _        |d
         | _	        dS )zA
        Set instance variables based on an options dict
        r&   Ú	verbosityÚlinkÚclearÚdry_runr,   r1   Ústaticfilesc                 óL   — h | ]!}t           j                             |¦  «        ’Œ"S © )Úosr    Únormpath)Ú.0Úps     r   ú	<setcomp>z&Command.set_options.<locals>.<setcomp>h   s(   € Ð$RÐ$RÐ$R¸Q¥R¤W×%5Ò%5°aÑ%8Ô%8Ð$RÐ$RÐ$Rr   r*   N)
r&   r6   Úsymlinkr8   r9   r   Úget_app_configr,   Úlistr*   )r   Úoptionsr,   s      r   Úset_optionszCommand.set_options\   s¤   € ð # =Ô1ˆÔØ  Ô-ˆŒØ˜v”ˆŒØ˜WÔ%ˆŒ
Ø˜yÔ)ˆŒØ!Ð"3Ô4ˆØÐ0Ô1ð 	RØ�tÔ2°=ÑAÔAÔQÑQˆOÝ#Ð$RÐ$RÀ/Ð$RÑ$RÔ$RÑSÔSˆÔØ# NÔ3ˆÔÐÐr   c                 óä  — | j         r| j        st          d¦  «        ‚| j        r|                      d¦  «         | j         r| j        }n| j        }i }t          ¦   «         D ]Ž}|                     | j	        ¦  «        D ]q\  }}t          |dd¦  «        r&t          j                             |j        |¦  «        }n|}||vr||f||<    ||||¦  «         ŒW|                      d|z  d¬¦  «         ŒrŒ�| j        rßt#          | j        d¦  «        rÊ| j                             || j        ¬	¦  «        }|D ]¦\  }}	}
t)          |
t*          ¦  «        r8| j                             d
|z  ¦  «         | j                             ¦   «          |
‚|
r9|                      d|›d|	›d�d¬¦  «         | j                             |¦  «         ŒŽ|                      d|z  ¦  «         Œ§| j        | j        z   | 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*   )r9   zPost-processing '%s' failed!zPost-processed 'z' as 'ú'é   zSkipped post-processing '%s')ÚmodifiedÚ
unmodifiedÚpost_processed)rB   r#   r	   r8   Ú	clear_dirÚ	link_fileÚ	copy_filer   rD   r,   Úgetattrr=   r    ÚjoinrH   Úlogr*   Úhasattrr   r9   Ú
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.collectk   sp  € ð Œ<ð 	I ¤
ð 	IÝÐGÑHÔHÐHàŒ:ð 	Ø�NŠN˜2ÑÔÐàŒ<ð 	%Ø”nˆGˆGà”nˆGàˆÝ!‘m”mð 	ð 	ˆFØ!'§¢¨TÔ-AÑ!BÔ!Bð ð ‘��gå˜7 H¨dÑ3Ô3ð )Ý$&¤G§L¢L°´ÀÑ$FÔ$F�M�Mà$(�Mà ¨Ð3Ð3Ø29¸4°�K Ñ.Ø�G˜D -°Ñ9Ô9Ð9Ð9à—H’Hð?ð BOñOð  ð ñ ô ð ð ðð( Ôð 	M¥¨¬°~Ñ!FÔ!Fð 	MØœ×1Ò1°+ÀtÄ|Ð1ÑTÔTˆIØ<Eð Mð MÑ8�˜~¨yÝ˜i­Ñ3Ô3ð $Ø”K×%Ò%Ð&DÀ}Ñ&TÑUÔUÐUð ”K×%Ò%Ñ'Ô'Ð'Ø#�OØð MØ—H’H�HØ9F¸¸ÈÈÈÐWØð ñ ô ð ð Ô-×4Ò4°]ÑCÔCÐCÐCà—H’HÐ;¸mÑKÑLÔLÐLÐLð Ô)¨DÔ,@Ñ@ØÔ/Ø"Ô7ð
ð 
ð 	
r   c                 ó  —  | j         di |¤Ž dg}| j        r|                     d¦  «         |                     d¦  «         |                      ¦   «         rr| j        j        rf| j        j        }|                     d|z  ¦  «         | j                             |¦  «        o&t          | j                             |¦  «        ¦  «        }nd }|                     d¦  «         d}| j	        r~|r|| j
        r|                     d¦  «         n|                     d¦  «         |                     d	¦  «         t          d
                     |¦  «        ¦  «        dk    rt          d¦  «        ‚|                      ¦   «         }| j        dk    r€t!          |d         ¦  «        }t!          |d         ¦  «        }t!          |d         ¦  «        }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         rd|z  pd
dœz  S d S )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.rI   rN   rO   rP   z]
%(modified_count)s %(identifier)s %(action)s%(destination)s%(unmodified)s%(post_processed)s.zstatic fileÚsÚ	symlinkedÚcopiedz to '%s'z, %s unmodifiedz, %s post-processed)Úmodified_countÚ
identifierr'   ÚdestinationrO   rP   r<   )rF   r9   r+   Úis_local_storager   ÚlocationÚexistsÚanyÚlistdirr&   r8   ÚinputrU   r	   rd   r6   ÚlenrB   )	r   rE   ÚmessageÚdestination_pathÚshould_warn_userÚ	collectedrk   Úunmodified_countÚpost_processed_counts	            r   ÚhandlezCommand.handleª   s�  € ØˆÔÐ#Ð#˜7Ð#Ð#Ð#Ø�&ˆØŒ<ð 	Ø�NŠNð ñô ð ð
 	�Šð5ñ	
ô 	
ð 	
ð
 × Ò Ñ"Ô"ð 
	$ t¤|Ô'<ð 
	$Ø#œ|Ô4ÐØ�NŠNÐ,Ð/?Ñ?Ñ@Ô@Ð@Ø#œ|×2Ò2Ð3CÑDÔDð  ÍØ”×$Ò$Ð%5Ñ6Ô6ñJô JÐÐð  $ÐØ�NŠN˜7Ñ#Ô#Ð#à#ÐàÔð 	IÐ 0ð 	IØŒzð HØ—’ÐOÑPÔPÐPÐPà—’ÐFÑGÔGÐGà�NŠNð>ñô ð õ �R—W’W˜WÑ%Ô%Ñ&Ô&¨%Ò/Ð/Ý"Ð#GÑHÔHÐHà—L’L‘N”Nˆ	àŒ>˜QÒÐÝ  ¨:Ô!6Ñ7Ô7ˆNÝ" 9¨\Ô#:Ñ;Ô;ÐÝ#& yÐ1AÔ'BÑ#CÔ#CÐ ðCð #1Ø+°^ÀqÒ5HÐ5H¨r¨rÈcÑRØ)-¬ÐC˜+˜+¸8à5EÐM�JÐ!1Ñ1Ð1È2ð ! Ô.ðÐ%Ð(8Ñ8Ð8àð Ð.Ô/ð EØ-Ð0DÑDðàðð ñð ð	 Ðr   rM   c                 óT   — | j         |k    r| j                             |¦  «         dS dS )z"
        Small log helper
        N)r6   Ústdoutr[   )r   ÚmsgrK   s      r   rV   zCommand.logí   s5   € ð Œ>˜UÒ"Ð"ØŒK×Ò˜cÑ"Ô"Ð"Ð"Ð"ð #Ð"r   c                 ó6   — t          | j        t          ¦  «        S r   )rX   r   r   r"   s    r   rn   zCommand.is_local_storageô   s   € Ý˜$œ,Õ(9Ñ:Ô:Ð:r   c                 ó  — | j                              |¦  «        sdS | j                              |¦  «        \  }}|D �]}t          j                             ||¦  «        }| j        r|                      d|z  d¬¦  «         ŒE|                      d|z  d¬¦  «         	 | j                              |¦  «        }t          j                             |¦  «        s4t          j                             |¦  «        rt          j	        |¦  «         ŒÍ| j          
                    |¦  «         Œè# t          $ r | j          
                    |¦  «         Y �Œw xY w|D ]5}|                      t          j                             ||¦  «        ¦  «         Œ6dS )zW
        Delete the given relative path using the destination storage backend.
        NúPretending to delete '%s'rI   rJ   úDeleting '%s')r   rp   rr   r=   r    rU   r9   rV   ÚlexistsÚunlinkÚdeleter!   rQ   )r   r    ÚdirsÚfilesÚfÚfpathÚ	full_pathÚds           r   rQ   zCommand.clear_dir÷   sŽ  € ð Œ|×"Ò" 4Ñ(Ô(ð 	ØˆFà”l×*Ò*¨4Ñ0Ô0‰ˆˆeØð 	3ñ 	3ˆAÝ”G—L’L  qÑ)Ô)ˆEØŒ|ð 3Ø—’Ð4°uÑ<ÀA�ÑFÔFÐFÐFà—’˜¨5Ñ0¸�Ñ:Ô:Ð:ð	3Ø $¤× 1Ò 1°%Ñ 8Ô 8�Iõ œ7Ÿ>š>¨)Ñ4Ô4ð 3½¼¿ºÈÑ9SÔ9Sð 3åœ	 )Ñ,Ô,Ð,Ð,àœ×+Ò+¨EÑ2Ô2Ð2Ð2øõ +ð /ð /ð /Ø”L×'Ò'¨Ñ.Ô.Ð.Ð.Ñ.ð/øøøð ð 	2ð 	2ˆAØ�NŠN�2œ7Ÿ<š<¨¨aÑ0Ô0Ñ1Ô1Ð1Ð1ð	2ð 	2s   ÂD$Ä$$EÅEc                 ó  — | j                              |¦  «        �rm	 | j                              |¦  «        }	 |                     |¦  «        }| j        rC| j                              |¦  «        }| j        t          j                             |¦  «        z   }nd}|                     d¬¦  «        |                     d¬¦  «        k    }|r?|r=|| j	        vr| j	         
                    |¦  «         |                      d|z  ¦  «         dS n.# t          t          f$ r Y nw xY w# t          t          f$ r Y nw xY w| j        r|                      d|z  ¦  «         n2|                      d|z  ¦  «         | j                              |¦  «         dS )zR
        Check if the target file should be deleted if it already exists.
        Tr   )ÚmicrosecondzSkipping '%s' (not modified)Fr�   r‚   )r   rp   Úget_modified_timer#   r    rB   r=   ÚislinkÚreplacer   r+   rV   ÚOSErrorr!   r9   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  sÖ  € ð Œ<×Ò˜}Ñ-Ô-ñ ,	3ð%%à'+¤|×'EÒ'EÀmÑ'TÔ'TÐ$ð
%à+9×+KÒ+KÈDÑ+QÔ+QÐ(ð
 ”zð 9Ø$(¤L×$5Ò$5°mÑ$DÔ$D˜	ð !œL­2¬7¯>ª>¸)Ñ+DÔ+DÑDð5Ð1Ð1ð 59Ð1à)=×)EÒ)EØ$%ð *Fñ *ô *à-×5Ò5À!Ð5ÑDÔDò*EÐ&ð *ð %Ð.Gð %Ø(°Ô0EÐEÐEØ Ô1×8Ò8¸ÑGÔGÐGØŸšÐ!?À$Ñ!FÑGÔGÐGØ$˜uøøõ7  Õ!4Ð5ð ð ð Ø�Dðøøøøõ Õ0Ð1ð ð ð à�ðøøøðH Œ|ð 3Ø—’Ð4°tÑ;Ñ<Ô<Ð<Ð<à—’˜¨4Ñ/Ñ0Ô0Ð0Ø”×#Ò# MÑ2Ô2Ð2Øˆts"   �D  ¸D	 Ä	DÄDÄ D4Ä3D4c                 ó:  — || j         v r|                      d|z  ¦  «        S |                      |||¦  «        sdS |                     |¦  «        }| j        r|                      d|z  d¬¦  «         �n|                      d|z  d¬¦  «         | j                             |¦  «        }t          j        t          j                             |¦  «        d¬	¦  «         	 t          j         	                    |¦  «        rt          j
        |¦  «         t          j        ||¦  «         nR# t          $ r) d
dl}t          d|                     ¦   «         z  ¦  «        ‚t          $ r}t          |¦  «        ‚d}~ww xY w|| j         vr| j                              |¦  «         dS dS )z*
        Attempt to link ``path``
        z&Skipping '%s' (already linked earlier)NzPretending to link '%s'rI   rJ   zLinking '%s'rM   T)Úexist_okr   z2Symlinking is not supported in this platform (%s).)r   rV   r—   r    r9   r   r=   ÚmakedirsÚdirnamerƒ   r„   rB   r!   Úplatformr	   r‘   r+   )r   r    r_   r’   Úsource_pathrŠ   rœ   Úes           r   rR   zCommand.link_fileE  s¾  € ð
 ˜DÔ0Ð0Ð0Ø—8’8ÐDÀtÑKÑLÔLÐLà×Ò  m°^ÑDÔDð 	ØˆFà$×)Ò)¨$Ñ/Ô/ˆàŒ<ð 	&Ø�HŠHÐ.°Ñ<ÀAˆHÑFÔFÐFÑFà�HŠH�^ kÑ1¸ˆHÑ;Ô;Ð;Øœ×)Ò)¨-Ñ8Ô8ˆIÝŒK�œŸš¨	Ñ2Ô2¸TÐBÑBÔBÐBð&Ý”7—?’? 9Ñ-Ô-ð )Ý”I˜iÑ(Ô(Ð(Ý”
˜;¨	Ñ2Ô2Ð2Ð2øÝ&ð ð ð Ø���å"ð%Ø'/×'8Ò'8Ñ':Ô':ñ;ñô ð õ ð &ð &ð &Ý" 1‘o”oÐ%øøøøð&øøøà Ô 4Ð4Ð4ØÔ ×'Ò'¨Ñ6Ô6Ð6Ð6Ð6ð 5Ð4s   ÃAD$ Ä$;E3ÅE.Å.E3c                 óà  — || j         v r|                      d|z  ¦  «        S |                      |||¦  «        sdS |                     |¦  «        }| j        r|                      d|z  d¬¦  «         nb|                      d|z  d¬¦  «         |                     |¦  «        5 }| j                             ||¦  «         ddd¦  «         n# 1 swxY w Y   | j                              |¦  «         dS )z7
        Attempt to copy ``path`` with storage
        z&Skipping '%s' (already copied earlier)NzPretending to copy '%s'rI   rJ   zCopying '%s'rM   )	r   rV   r—   r    r9   Úopenr   Úsaver+   )r   r    r_   r’   r�   Úsource_files         r   rS   zCommand.copy_fileh  s;  € ð
 ˜DÔ-Ð-Ð-Ø—8’8ÐDÀtÑKÑLÔLÐLà×Ò  m°^ÑDÔDð 	ØˆFà$×)Ò)¨$Ñ/Ô/ˆàŒ<ð 	>Ø�HŠHÐ.°Ñ<ÀAˆHÑFÔFÐFÐFà�HŠH�^ kÑ1¸ˆHÑ;Ô;Ð;Ø×$Ò$ TÑ*Ô*ð >¨kØ”×!Ò! -°Ñ=Ô=Ð=ð>ð >ð >ñ >ô >ð >ð >ð >ð >ð >ð >øøøð >ð >ð >ð >àÔ× Ò  Ñ/Ô/Ð/Ð/Ð/s   Â!C	Ã	CÃC)rM   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r)   r   r:   Úrequires_system_checksr   r   r#   r4   rF   rd   r{   rV   rn   rQ   r—   rR   rS   Ú__classcell__)r   s   @r   r   r      s  ø€ € € € € ðð ð
 8€DØ"Ô.Ð/Ðð ð  ð  ð  ð  ð ðð ñ „_ðð3
ð 3
ð 3
ðj4ð 4ð 4ð=
ð =
ð =
ð~Að Að AðF#ð #ð #ð #ð;ð ;ð ;ð2ð 2ð 2ð61ð 1ð 1ðf!7ð !7ð !7ðF0ð 0ð 0ð 0ð 0ð 0ð 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   r<   r   r   ú<module>r±      sâ   ðØ 	€	€	€	à Ð Ð Ð Ð Ð Ø :Ð :Ð :Ð :Ð :Ð :Ø BÐ BÐ BÐ BÐ BÐ BØ #Ð #Ð #Ð #Ð #Ð #Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø AÐ AÐ AÐ AÐ AÐ AÐ AÐ AØ 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3ðn0ð n0ð n0ð n0ð n0ˆkñ n0ô n0ð n0ð n0ð n0r   