
    h                     T    d dl Z d dlmZ d dlmZmZ d dlmZmZ d Z	 G d de      Z
y)    N)OrderedDict)BaseCommandCommandParser)color_styleno_stylec           
      f   | j                  ddddd       | j                  ddd	d
dt        g dd       | j                  dd       | j                  dd       | j                  ddd       | j                  ddddd       | j                  ddddd       | j                  ddd dd!       y )"Nz	--noinputstore_falseinteractiveTz>Tells Django CMS to NOT prompt the user for input of any kind.)actiondestdefaulthelpz-vz--verbositystore	verbosity1)r            z[Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output)r   r   r   typechoicesr   z
--settingszThe Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.)r   z--pythonpathzMA directory to add to the Python path, e.g. "/home/djangoprojects/myproject".z--traceback
store_truez Raise on CommandError exceptions)r   r   z
--no-colorno_colorFz"Don't colorize the command output.z--force-colorforce_colorzColorize the command output.z--skip-checksskip_checkszSkip the checks.)add_argumentintparsers    g/home/dcms/DCMS/lib/python3.12/site-packages/djangocms_frontend/management/commands/subcommands/base.pyadd_builtin_argumentsr       s   
M   j  	 H   \   lAcd
1   +         c                   @    e Zd Z e       Zi ZdZdZdZdZ	d Z
d Zd Zy)SubcommandsCommand )r
   subcmdc                     i }t        dt        j                  j                  |       d| | j                  xs d d|}t        |       | j                  |       |S )N )progdescription )r   ospathbasenamer   r    add_arguments)self	prog_name
subcommandkwargsr   s        r   create_parserz SubcommandsCommand.create_parserJ   sg     
GG$$Y/0*>		)T
 

 	f%6"r!   c                    i | _         | j                  r;t        | j                        }|j	                  | j
                        }| j                  j                         D ]  \  }} || j                  j                  | j                  j                        }| j                  |_
        i } |j                  d|j                  |j                  |j                  d|}t        |       |j                  |       |j!                  |j"                  D 	ch c]  }	|	j$                   c}	       || j                   |<    t'        |      | _        y y c c}	w )N)r   )namer   r)   r   r*   )	instancessubcommandssetstealth_optionsadd_subparserssubcommand_destitemsstdout_outstderrstyle
add_parsercommand_namehelp_stringr    r.   update_actionsr   tuple)
r/   r   r9   
subparserscommandclsinstancer2   
parser_subr   s
             r   r.   z SubcommandsCommand.add_argumentsU   s,   !$"6"67O..D4H4H.IJ $ 0 0 6 6 8 3t{{//1A1AB!%2Z22 !..!-- ( 4 4 	
 &Z8&&z2&&*BUBU'V'VW*2w'3 $)#9D %   (Ws   E
c                 &   || j                      | j                  v r| j                  || j                         }|j                  d      r t               |_        d |j
                  _        |j                  d      rt        d      |_        |j                  d      r |j                  d      |j                  _	        |j                  d      r |j                  d      |j
                  _	         |j                  |i | y | j                  dd       y )	Nr   r   T)r   r=   r?   z	manage.pyfrontend)r;   r6   getr   r@   r?   
style_funcr   r=   r>   handle
print_help)r/   argsoptionsrH   s       r   rP   zSubcommandsCommand.handlel   s    4''(DNN:nnWT-A-A%BCG{{:& (
,0){{=) + ={{8$&-kk(&;#{{8$&-kk(&;#GNND,G,OOK4r!   N)__name__
__module____qualname__r   r7   r6   rC   rB   r9   r;   r3   r.   rP   r*   r!   r   r#   r#   A   s1    -KIKL&OO	:.5r!   r#   )r+   collectionsr   django.core.management.baser   r   django.core.management.colorr   r   r    r#   r*   r!   r   <module>rZ      s#    	 # B >6r95 95r!   