Ë
    ¹ûàg!;  ã                   ó†   — 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 | _        t        | _        t        «       | _	        y ©N)
ÚsuperÚ__init__Úcopied_filesÚsymlinked_filesÚunmodified_filesÚpost_processed_filesr   Ústorager
   Ústyle)ÚselfÚargsÚkwargsÚ	__class__s      €úz/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.pyr   zCommand.__init__   sE   ø€ Ü‰Ñ˜$Ð) &Ò)ØˆÔØ!ˆÔØ "ˆÔØ$&ˆÔ!Ü*ˆŒÜ“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,   r1   Ústaticfilesr*   N)r&   r6   Úsymlinkr8   r9   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                 ó6  — | j                   r| j                  st        d«      ‚| j                  r| j	                  d«       | j                   r| j
                  }n| j                  }i }t        «       D ]‹  }|j                  | j                  «      D ]k  \  }}t        |dd«      r+t        j                  j                  |j                  |«      }n|}||vr||f||<    ||||«       ŒV| j                  d|z  d¬«       Œm Œ� | j                   rÞt#        | j$                  d«      rÈ| j$                  j!                  || j&                  ¬	«      }|D ]œ  \  }}	}
t)        |
t*        «      r:| j,                  j/                  d
|z  «       | j,                  j/                  «        |
‚|
r6| j                  d|›d|	›d�d¬«       | j0                  j3                  |«       Œ‰| j                  d|z  «       Œž | j4                  | j6                  z   | j8                  | j0                  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)r;   r#   r	   r8   Ú	clear_dirÚ	link_fileÚ	copy_filer   r=   r,   Úgetattrr>   r    ÚjoinrD   Ú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   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à—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\  rmt!        |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   xr d|z  x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.rE   rJ   rK   rL   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'   ÚdestinationrK   rL   © )rB   r9   r+   Úis_local_storager   ÚlocationÚexistsÚanyÚlistdirr&   r8   ÚinputrQ   r	   r`   r6   Úlenr;   )	r   r@   ÚmessageÚdestination_pathÚshould_warn_userÚ	collectedrg   Úunmodified_countÚpost_processed_counts	            r   ÚhandlezCommand.handleª   sÿ  € Øˆ×ÑÑ#˜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ÒÜ  ¨:Ñ!6Ó7ˆNÜ" 9¨\Ñ#:Ó;ÐÜ#& yÐ1AÑ'BÓ#CÐ ðCð #1Ø+°^ÀqÒ5H©rÈcÑRØ)-¯ª™+¸8á5E�JÐ!1Ò1È2ð ! Ò.ð &Ð(8Ò8àð Ð.Ñ/ò EØ-Ð0DÑDòàññð ð	 r   c                 óZ   — | j                   |k\  r| j                  j                  |«       yy)z"
        Small log helper
        N)r6   ÚstdoutrW   )r   ÚmsgrG   s      r   rR   zCommand.logí   s'   € ð �>‰>˜UÒ"Ø�K‰K×Ñ˜cÕ"ð #r   c                 ó6   — t        | j                  t        «      S r   )rT   r   r   r"   s    r   rk   zCommand.is_local_storageô   s   € Ü˜$Ÿ,™,Ô(9Ó:Ð:r   c                 ó  — | j                   j                  |«      sy| j                   j                  |«      \  }}|D ]æ  }t        j                  j                  ||«      }| j                  r| j                  d|z  d¬«       ŒF| j                  d|z  d¬«       	 | j                   j	                  |«      }t        j                  j                  |«      s5t        j                  j                  |«      rt        j                  |«       ŒÌ| j                   j                  |«       Œè |D ]1  }| j                  t        j                  j                  ||«      «       Œ3 y# t        $ r | j                   j                  |«       Y �ŒGw xY w)zW
        Delete the given relative path using the destination storage backend.
        NúPretending to delete '%s'rE   rF   úDeleting '%s')r   rm   ro   r>   r    rQ   r9   rR   ÚlexistsÚunlinkÚdeleter!   rM   )r   r    ÚdirsÚfilesÚfÚfpathÚ	full_pathÚds           r   rM   zCommand.clear_dir÷   s-  € ð �|‰|×"Ñ" 4Ô(Øà—l‘l×*Ñ*¨4Ó0‰ˆˆeØò 	3ˆAÜ—G‘G—L‘L  qÓ)ˆEØ�|Š|Ø—‘Ð4°uÑ<ÀA�ÕFà—‘˜¨5Ñ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   ÂEÅ$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        t        f$ r Y Œgw xY w# t        t        t        f$ r Y Œ�w 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   rm   Úget_modified_timer#   r    r;   r>   ÚislinkÚreplacer   r+   rR   ÚOSErrorr!   ÚAttributeErrorr9   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|  € ð �<‰<×Ñ˜}Õ-ð%%à'+§|¡|×'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´nÐEò Ùðûô Ô0´.ÐAò áðús"   žE4 ºE ÅE1Å0E1Å4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'rE   rF   zLinking '%s'rI   T)Úexist_okr   z2Symlinking is not supported in this platform (%s).)r   rR   r•   r    r9   r   r>   ÚmakedirsÚdirnamer€   r�   r;   r!   Úplatformr	   rŽ   r+   )r   r    r[   r�   Úsource_pathr‡   rš   Úes           r   rN   zCommand.link_fileE  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'rE   rF   zCopying '%s'rI   )	r   rR   r•   r    r9   Úopenr   Úsaver+   )r   r    r[   r�   r›   Úsource_files         r   rO   zCommand.copy_fileh  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)rI   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r)   r   r:   Úrequires_system_checksr   r   r#   r4   rB   r`   rx   rR   rk   rM   r•   rN   rO   Ú__classcell__)r   s   @r   r   r      so   ø„ ñð
 8€DØ"×.Ñ.Ð/Ðô ð ñó ðò3
òj4ò=
ò~AóF#ò;ò2ò61ò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   rj   r   r   ú<module>r¯      s.   ðÛ 	å Ý :Ý BÝ #Ý 7ß AÝ 1Ý 3ôn0ˆkõ n0r   