
    &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dashboard.pyc                       e Zd ZdZd ZddZy)Commandz_Creates a template file containing the base code to get you started with your custom dashboard.c                 2    |j                  dt               y )Noutput_file)type)add_argumentstr)selfparsers     r/var/www/html/djangosite/lib/python3.12/site-packages/admin_tools/dashboard/management/commands/customdashboard.pyadd_argumentszCommand.add_arguments   s    M4    Nc                 H   i }t         j                  j                  t        j                               |d<   ddg}|d uxr |xs t        }t         j                  j                  |      rt        d|z        t         j                  j                  |      j                  d      d   |d<   t        |d      5 }|j                  t        ||             d d d        | j                  j                  d	t         j                  j                  |      z         y # 1 sw Y   ExY w)
Nprojectzdashboard/dashboard.txtz#admin_tools/dashboard/dashboard.txtzfile "%s" already exists.r   filewz"%s" written.)ospathbasenamegetcwdDEFAULT_FILEexistsr   splitopenwriter   stdoutjoin)r   r	   optionscontexttpldstfs          r   handlezCommand.handle   s    WW--biik:	%1
 %5+E77>>#9C?@@''**3/55c:1=#s^ 	4qGG$S'23	4/BGGLL,==>	4 	4s   8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   