3
g                 @   sl   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 deZdS )	    N)join)List)settings)BaseCommandCommandError)signalcommandc               @   s2   e Zd ZU dZg Zee dd Zedd Z	dS )Commandz.Compile python bytecode files for the project.c             C   s   |j dddddd d S )Nz--pathz-pstorepathzSpecify path to recurse into)actiondesthelp)add_argument)selfparser r   o/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django_extensions/management/commands/compile_pyc.pyadd_arguments   s    zCommand.add_argumentsc       
      O   s   |d }|st tdd }|d }|s,tdxZtj|D ]L\}}}x@tj|dD ]0}t||}	|dkrv| jj	d|	  t
j|	 qPW q8W d S )Nr
   Z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optionsZproject_rootr   rootdirs	filenamesfilename	full_pathr   r   r   handle   s    
zCommand.handleN)
__name__
__module____qualname__r   Zrequires_system_checksr   strr   r   r'   r   r   r   r   r      s   
r   )r   r   r   os.pathr   r   typingr   Zdjango.confr   Zdjango.core.management.baser   r   Z"django_extensions.management.utilsr   r   r   r   r   r   <module>   s   