
    jg                     r    d dl Z d dlZd dl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  G d de      Zy)	    N)join)List)settings)BaseCommandCommandError)signalcommandc                   <    e Zd ZU dZg Zee   ed<   d Ze	d        Z
y)Commandz.Compile python bytecode files for the project.requires_system_checksc                 0    |j                  ddddd       y )Nz--pathz-pstorepathzSpecify path to recurse into)actiondesthelp)add_argument)selfparsers     l/var/www/html/Stanley/venv/lib/python3.12/site-packages/django_extensions/management/commands/compile_pyc.pyadd_argumentszCommand.add_arguments   s!    Hd7!? 	 	A    c                 R   |d   }|st        t        dd       }|d   }|st        d      t        j                  |      D ]e  \  }}}t        j                  |d      D ]F  }t        ||      }	|dkD  r| j                  j                  d|	z         t        j                  |	       H g y )Nr   BASE_DIR	verbosityz=No --path specified and settings.py does not contain BASE_DIRz*.py   zCompiling %s...
)getattrr   r   oswalkfnmatchfilter_jstdoutwrite
py_compilecompile)
r   argsoptionsproject_rootr   rootdirs	filenamesfilename	full_paths
             r   handlezCommand.handle   s    v"8Z>LK(	^__%'WW\%:!D$	#NN9f=tX.	q=KK%%&9I&EF""9-	 > &;r   N)__name__
__module____qualname__r   r   r   str__annotations__r   r   r.    r   r   r
   r
      s0    ;D(*DI*A . .r   r
   )r   r   r$   os.pathr   r!   typingr   django.confr   django.core.management.baser   r   "django_extensions.management.utilsr   r
   r4   r   r   <module>r:      s)     	      A <.k .r   