
    &g:                     B    d dl Z d dlmZmZ d dlmZ dZ G d de      Zy)    N)BaseCommandCommandError)render_to_stringzmenu.pyc                       e Zd ZdZd ZddZy)CommandzYCreates a template file containing the base code to get you started with your custom menuc                 2    |j                  dt               y )Noutput_file)type)add_argumentstr)selfparsers     h/var/www/html/djangosite/lib/python3.12/site-packages/admin_tools/menu/management/commands/custommenu.pyadd_argumentszCommand.add_arguments   s    M4    Nc           
      2   t         j                  j                  t        j                               }|d uxr |xs t        }t         j                  j                  |      rt        d|z        t        |d      5 }|j                  t        d|t         j                  j                  |      j                  d      d   d             d d d        | j                  j                  dt         j                  j                  |      z         y # 1 sw Y   ExY w)NzError: file "%s" already existswzadmin_tools/menu/menu.txt.r   )projectfilez"%s" written.)ospathbasenamegetcwdDEFAULT_FILEexistsr   openwriter   splitstdoutjoin)r   r	   optionsproject_namedstfs         r   handlezCommand.handle   s    ww''		4%5+E77>>#@3FGG#s^ 		qGG /#/ " 0 0 5 ; ;C @ C		 	/BGGLL,==>		 		s   ;ADD)N)__name__
__module____qualname__helpr   r&    r   r   r   r   	   s    	( 	
5?r   r   )r   django.core.management.baser   r   django.template.loaderr   r   r   r+   r   r   <module>r.      s!    	 A 3 ?k ?r   