https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/core/management/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/core/management/templates.pyc
�
r�\c@sTddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlmZddl
Z
ddlmZmZddlmZddlmZddlmZddlmZmZdd	lmZejd
ej�Zejdej�Zdefd
��YZ dS(i����N(tmake_option(tpath(tTemplatetContext(tarchive(turlretrieve(trmtree_errorhandler(tBaseCommandtCommandError(thandle_extensionss	^([a-z]):s^([a-z])[:|]tTemplateCommandcBs�eZdZdZejeddddddd�ed	d
ddddd
dgdd�eddddddd
gdd�fZeZeZ	dddgZ
eZdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS( s�
    Copies either a Django application layout template or a Django project
    layout template into the specified directory.

    :param style: A color style object (see django.core.management.color).
    :param app_or_project: The string 'app' or 'project'.
    :param name: The name of the application or project.
    :param directory: The directory to which the template should be copied.
    :param options: The additional variables passed to project or app templates
    s'[name] [optional destination directory]s
--templatetactiontstoretdestttemplatethelps*The path or URL to load the template from.s--extensions-et
extensionstappendtdefaulttpystThe file extension(s) to render (default: "py"). Separate multiple extensions with commas, or use -e multiple times.s--names-ntfiless_The file name(s) to render. Separate multiple extensions with commas, or use -n multiple times.thttpthttpstftpc"
KsA||_g|_t|jd��|_|j||�|dkr�tjt	j
�|�}yt	j|�Wq�tk
r�}|j
t
jkr�d|}n|}t|��q�Xn@t	jjtj|��}t	jj|�s�td|��ntt|jd�dd'��}g}	x9|jd�D](}
|	jtd�|
jd���q0W|jd	kr�|jjd
|dj|�f�|jjd|dj|	�f�nd
|}d|}d|}
tjddkr�d}ndtjd	 }tt|i||6||
6|d6�dt�}ddlm }|j!sU|j"�n|j#|jd�|�}t$|�d}xFt	j%|�D]5\}}}||}|j&||�}|r�tj||�}tj|�s�t	j'|�q�nx:|D]1}|j(d�s|dkr�|j)|�q�q�Wx�|D]�}|j*d(�rTq9ntj||�}tj|||j&||��}tj|�r�td|��nt+|d ��}|j,�}WdQX|j*|�s�||	kr$|j-d!�}t.|�}|j/|�}|j0d!�}nt+|d"��} | j|�WdQX|jd	kro|jjd#|�ny!t1j2||�|j3|�Wq9tk
r�|j4jd$||j5j6�q9Xq9Wq�W|jr=|jd	kr�|jjd%�nxF|jD]8}!tj7|!�r#t	j)|!�q�t1j8|!d&t9�q�WndS()Nt	verbositys'%s' already existssBDestination directory '%s' does not exist, please create it first.RtignoredRcSs
|j�S(N(tstrip(tx((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyt<lambda>]st,is0Rendering %s template files with extensions: %s
s, s/Rendering %s template files with filenames: %s
s%s_names%s_templates%s_directoryi����tfinaltdevs%d.%dtdocs_versiont
autoescapei����(tsettingsRit.t__pycache__s.pyos.pycs	.py.classsi%s already exists, overlaying a project or app into an existing directory won't replace conflicting filestrbsutf-8twbsCreating %s
skNotice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.sCleaning up temporary files.
tonerror((s.pyos.pycs	.py.class(:tapp_or_projecttpaths_to_removetinttgetRt
validate_nametNoneRtjointostgetcwdtmakedirstOSErrorterrnotEEXISTRtabspatht
expandusertexiststtupleR	textendtmaptsplittstdouttwritetdjangotVERSIONRtdicttFalsetdjango.confR"t
configuredt	configurethandle_templatetlentwalktreplacetmkdirt
startswithtremovetendswithtopentreadtdecodeRtrendertencodetshutiltcopymodetmake_writeabletstderrtstyletNOTICEtisfiletrmtreeR("tselfR(tnamettargettoptionsttop_dirtetmessageRtextra_filestfilet	base_nametbase_subdirtbase_directoryR tcontextR"ttemplate_dirt
prefix_lengthtroottdirsRt	path_resttrelative_dirt
target_dirtdirnametfilenametold_pathtnew_patht
template_filetcontentRtnew_filetpath_to_remove((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pythandleAs�		

&


	
		
	



		cCs�|dkr&tjtjdd|�S|jd�rB|d}ntj|�}tj|�}tj|�rs|S|j	|�r�|j
|�}ntj|�}tj|�r�|j
|�Std|j|f��dS(s�
        Determines where the app or project templates are.
        Use django.__path__[0] as the default because we don't
        know into which directory Django has been installed.
        itconfsfile://iscouldn't handle %s template %s.N(R-RR.R>t__path__RJR6tnormpathtisdirtis_urltdownloadR5R7textractRR((RZRtsubdirtexpanded_templatet
absolute_path((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyRE�s

cCs�|dkr7td|dkr$dnd|f��ntjd|�s�tjd|�sdd}nd}td	|||f��ndS(
Nsyou must provide %s %s nametapptantas^[_a-zA-Z]\w*$s
^[_a-zA-Z]s5make sure the name begins with a letter or underscores)use only numbers, letters and underscoress%%r is not a valid %s name. Please %s.(R-Rtretsearch(RZR[R(R`((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR,�s%	cCs�d�}d|j}tjd|dd�}|jj|�||�\}}|jdkrv|jjd|�ny%t|t	j
||��\}}Wn,tk
r�}	td|||	f��nX|j
d	�d
}
|jd�}|rtj|�\}}
|
jd�p|
}n|
}|j|�d
}|jd�}|ry|rytj|�}|ry||7}qyn|
|kr�t	j
||�}tj||�|S|S(sD
        Downloads the given URL and returns the file name.
        cSsN|jd�}|jd�d}|jd�r>|d}n|}||fS(Nt/i����(trstripR;RL(turlttmpRotdisplay_url((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pytcleanup_url�s
sdjango_%s_template_tprefixtsuffixt	_downloadisDownloading %s
s"couldn't download URL %s to %s: %sR�i����scontent-dispositionRoiscontent-type(R(ttempfiletmkdtempR)RRR<R=RRR.tIOErrorRR;R+tcgitparse_headertsplitextt	mimetypestguess_extensionRRtmove(RZR�R�R�ttempdirRoR�tthe_pathtinfoR_t	used_nametcontent_dispositiont_tparamstguessed_filenametexttcontent_typetguessed_path((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR|�s:		
%
cCsOtj|�\}}|j�jd�rE|d|}|d }n||fS(s@
        Like os.path.splitext, but takes off .tar, too
        s.tari����(t	posixpathR�tlowerRL(RZR�tbaseR�((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR�s

cCs�d|j}tjd|dd�}|jj|�|jdkr[|jjd|�nytj	||�|SWn5tj
tfk
r�}td|||f��nXdS(	s�
        Extracts the given file to a temporarily and returns
        the path of the directory with the extracted content.
        sdjango_%s_template_R�R�t_extractisExtracting %s
s"couldn't extract file %s to %s: %sN(
R(R�R�R)RRR<R=RR}tArchiveExceptionR�R(RZRoR�R�R_((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR} s
cCs9d|krtS|jdd�dj�}||jkS(s;
        Returns True if the name looks like a URL
        t:ii(RAR;R�turl_schemes(RZRtscheme((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR{1scCsjtjjd�rdStj|tj�sftj|�}tj|j�tj	B}tj
||�ndS(sb
        Make sure that the file is writeable.
        Useful if our source is read-only.
        tjavaN(tsystplatformRJR/taccesstW_OKtstattS_IMODEtst_modetS_IWUSRtchmod(RZRotsttnew_permissions((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyRT:sN(t__name__t
__module__t__doc__targsRtoption_listRRAtrequires_model_validationtcan_import_settingsR�tTruetleave_locale_aloneR-RvRER,R|R�R}R{RT(((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyR
s0
	
w			6	
			(!R�R3R�R/R�R�RRR�R�R�toptparseRRR>tdjango.templateRRtdjango.utilsRt%django.utils.six.moves.urllib.requestRtdjango.utils._osRtdjango.core.management.baseRRtdjango.core.management.utilsR	tcompiletIt	_drive_ret
_url_drive_reR
(((sB/tmp/pip-install-XxeQeY/django/django/core/management/templates.pyt<module>s*

https://t.me/AnonymousX5 - 2025