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/base.pyc
�
r�\c@s!dZddlmZddlZddlZddlmZmZddlZddl	m
Z
ddlmZddl
mZddlmZd	efd
��YZd�Zdefd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdS(u�
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).

i����(tunicode_literalsN(tmake_optiontOptionParser(tImproperlyConfigured(tcolor_style(t	force_str(tStringIOtCommandErrorcBseZdZRS(u�
    Exception class indicating a problem while executing a management
    command.

    If this exception is raised during the execution of a management
    command, it will be caught and turned into a nicely-printed error
    message to the appropriate output stream (i.e., stderr); as a
    result, raising this exception (with a sensible description of the
    error) is the preferred way to indicate that something has gone
    wrong in the execution of a command.

    (t__name__t
__module__t__doc__(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRscCsB|jr|jtjd<n|jr>tjjd|j�ndS(u�
    Include any default options that all commands should accept here
    so that ManagementUtility can handle them before searching for
    user commands.

    uDJANGO_SETTINGS_MODULEiN(tsettingstostenviront
pythonpathtsystpathtinsert(toptions((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pythandle_default_options$s		t
OutputWrappercBs5eZdZddd�Zd�Zddd�ZRS(u&
    Wrapper around stdout/stderr
    u
cCsF||_d|_t|d�r9|j�r9||_n||_dS(Nuisatty(t_outtNonet
style_functhasattrtisattytending(tselftoutRR((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt__init__5s
		cCst|j|�S(N(tgetattrR(Rtname((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt__getattr__<scCs�|dkr|jn|}|r>|j|�r>||7}ng||jd�fD]}|dk	rT|^qTd}|jjt||���dS(NcSs|S(N((tx((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt<lambda>Csi(RRtendswithRRtwriteR(RtmsgRRtf((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR$?s
N(RR	R
RRR R$(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR1s	tBaseCommandcBs�eZdZeddddddddd	d
dddd
dgdd�eddd�eddd�eddddd�fZdZdZeZeZ	e
Ze
Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd"e
d �Zd!�ZRS(#u�
    The base class from which all management commands ultimately
    derive.

    Use this class if you want access to all of the mechanisms which
    parse the command-line arguments and work out what code to call in
    response; if you don't need to change any of that behavior,
    consider using one of the subclasses defined in this file.

    If you are interested in overriding/customizing various aspects of
    the command-parsing and -execution behavior, the normal flow works
    as follows:

    1. ``django-admin.py`` or ``manage.py`` loads the command class
       and calls its ``run_from_argv()`` method.

    2. The ``run_from_argv()`` method calls ``create_parser()`` to get
       an ``OptionParser`` for the arguments, parses them, performs
       any environment changes requested by options like
       ``pythonpath``, and then calls the ``execute()`` method,
       passing the parsed arguments.

    3. The ``execute()`` method attempts to carry out the command by
       calling the ``handle()`` method with the parsed arguments; any
       output produced by ``handle()`` will be printed to standard
       output and, if the command is intended to produce a block of
       SQL statements, will be wrapped in ``BEGIN`` and ``COMMIT``.

    4. If ``handle()`` or ``execute()`` raised any exception (e.g.
       ``CommandError``), ``run_from_argv()`` will  instead print an error
       message to ``stderr``.

    Thus, the ``handle()`` method is typically the starting point for
    subclasses; many built-in commands and command types either place
    all of their logic in ``handle()``, or perform some additional
    parsing work in ``handle()`` and then delegate from it to more
    specialized methods as needed.

    Several attributes affect behavior at various steps along the way:

    ``args``
        A string listing the arguments accepted by the command,
        suitable for use in help messages; e.g., a command which takes
        a list of application names might set this to '<appname
        appname ...>'.

    ``can_import_settings``
        A boolean indicating whether the command needs to be able to
        import Django settings; if ``True``, ``execute()`` will verify
        that this is possible before proceeding. Default value is
        ``True``.

    ``help``
        A short description of the command, which will be printed in
        help messages.

    ``option_list``
        This is the list of ``optparse`` options which will be fed
        into the command's ``OptionParser`` for parsing arguments.

    ``output_transaction``
        A boolean indicating whether the command outputs SQL
        statements; if ``True``, the output will automatically be
        wrapped with ``BEGIN;`` and ``COMMIT;``. Default value is
        ``False``.

    ``requires_model_validation``
        A boolean; if ``True``, validation of installed models will be
        performed prior to executing the command. Default value is
        ``True``. To validate an individual application's models
        rather than all applications' models, call
        ``self.validate(app)`` from ``handle()``, where ``app`` is the
        application's Python module.

    ``leave_locale_alone``
        A boolean indicating whether the locale set in settings should be
        preserved during the execution of the command instead of being
        forcibly set to 'en-us'.

        Default value is ``False``.

        Make sure you know what you are doing if you decide to change the value
        of this option in your custom command if it creates database content
        that is locale-sensitive and such content shouldn't contain any
        translations (like it happens e.g. with django.contrim.auth
        permissions) as making the locale differ from the de facto default
        'en-us' might cause unintended effects.

        This option can't be False when the can_import_settings option is set
        to False too because attempting to set the locale needs access to
        settings. This condition will generate a CommandError.
    u-vu--verbositytactionustoretdestu	verbositytdefaultu1ttypeuchoicetchoicesu0u2u3thelpu[Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose outputu
--settingsu�The 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.u--pythonpathuMA directory to add to the Python path, e.g. "/home/djangoprojects/myproject".u--tracebacku
store_trueuRaise on exceptionucCst�|_dS(N(Rtstyle(R((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR�scCs
tj�S(u�
        Return the Django version, which should be correct for all
        built-in Django commands. User-supplied commands should
        override this method.

        (tdjangotget_version(R((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR0�scCs5d||jf}|jr-d||jfS|SdS(u~
        Return a brief description of how to use this command, by
        default from the attribute ``self.help``.

        u%%prog %s [options] %su%s

%sN(targsR-(Rt
subcommandtusage((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR3�s	c	Cs1td|d|j|�d|j�d|j�S(u|
        Create and return the ``OptionParser`` which will be used to
        parse the arguments to this command.

        tprogR3tversiontoption_list(RR3R0R6(Rt	prog_nameR2((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt
create_parser�scCs |j||�}|j�dS(ub
        Print the help message for this command, derived from
        ``self.usage()``.

        N(R8t
print_help(RR7R2tparser((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR9�scCs�|j|d|d�}|j|d�\}}t|�y|j||j�Wn�tk
r�}|jst|t�r��nt	|dt
tj|j
j��}|jd|jj|f�tjd�nXdS(uZ
        Set up any environment changes requested (e.g., Python path
        and Django settings), then run this command. If the
        command raises a ``CommandError``, intercept it and print it sensibly
        to stderr. If the ``--traceback`` option is present or the raised
        ``Exception`` is not ``CommandError``, raise it.
        iiiustderru%s: %sN(R8t
parse_argsRtexecutet__dict__t	Exceptiont	tracebackt
isinstanceRRRRtstderrR.tERRORR$t	__class__Rtexit(RtargvR:RR1teRA((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt
run_from_argv�s
$c
Os�t|jdtj��|_t|jdtj�|jj�|_|jraddlm	}nd
}|js�|js�td|j|jf��nddl
m}|j�}|jd�nz�|jr�|jd�r�|j�n|j||�}|r�|jrtdd	lm}m}||jd
|�}	|	jj�rt|jj|jj|	jj���qtn|jj|�|jr�|jjd|jjd��q�nWd
|d
k	r�|j|�nXd
S(u�
        Try to execute this command, performing model validation if
        needed (as controlled by the attribute
        ``self.requires_model_validation``, except if force-skipped).
        ustdoutustderri����(Ru`Incompatible values of 'leave_locale_alone' (%s) and 'can_import_settings' (%s) command options.(ttranslationuen-ususkip_validation(tconnectionstDEFAULT_DB_ALIASudatabaseu
uCOMMIT;N(RtgetRtstdoutRAR.RBtcan_import_settingstdjango.confRRtleave_locale_aloneRtdjango.utilsRHtget_languagetactivatetrequires_model_validationtvalidatethandletoutput_transactiont	django.dbRIRJtopststart_transaction_sqlR$tSQL_KEYWORD(
RR1RRtsaved_localeRHtoutputRIRJt
connection((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR<�s8'			
	+	*cCs�ddlm}t�}|||�}|rZ|jd�|j�}td|��n|r�|jjd||dkr�dndf�nd	S(
u�
        Validates the given app, raising CommandError for any errors.

        If app is None, then this will validate all installed apps.

        i����(tget_validation_errorsiu'One or more models did not validate:
%su%s error%s foundiuusN(t!django.core.management.validationR^RtseektreadRRLR$(Rtapptdisplay_num_errorsR^tst
num_errorst
error_text((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRT-s	
cOs
t��dS(ub
        The actual logic of the command. Subclasses must implement
        this method.

        N(tNotImplementedError(RR1R((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRU>sN(RR	R
RR6R-R1tTrueRMRStFalseRVRORR0R3R8R9RGR<RRTRU(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR'Hs2\											1t
AppCommandcBs&eZdZdZd�Zd�ZRS(u
    A management command which takes one or more installed application
    names as arguments, and does something with each of them.

    Rather than implementing ``handle()``, subclasses must implement
    ``handle_app()``, which will be called once for each application.

    u<appname appname ...>c
Os�ddlm}|s%td��ny&g|D]}|j|�^q/}Wn)ttfk
rv}td|��nXg}x6|D].}|j||�}	|	r�|j|	�q�q�Wdj|�S(Ni����(tmodelsuEnter at least one appname.u8%s. Are you sure your INSTALLED_APPS setting is correct?u
(	RWRkRtget_appRtImportErrort
handle_apptappendtjoin(
Rt
app_labelsRRkt	app_labeltapp_listRFR\Rbt
app_output((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRURs&
cKs
t��dS(u�
        Perform the command's actions for ``app``, which will be the
        Python module corresponding to an application name given on
        the command line.

        N(Rg(RRbR((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRnas(RR	R
R1RURn(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRjGs	tLabelCommandcBs,eZdZdZdZd�Zd�ZRS(u�
    A management command which takes one or more arbitrary arguments
    (labels) on the command line, and does something with each of
    them.

    Rather than implementing ``handle()``, subclasses must implement
    ``handle_label()``, which will be called once for each label.

    If the arguments should be names of installed applications, use
    ``AppCommand`` instead.

    u<label label ...>ulabelcOsh|std|j��ng}x6|D].}|j||�}|r)|j|�q)q)Wdj|�S(NuEnter at least one %s.u
(Rtlabelthandle_labelRoRp(RtlabelsRR\Rvtlabel_output((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRU{s
cKs
t��dS(u~
        Perform the command's actions for ``label``, which will be the
        string as given on the command line.

        N(Rg(RRvR((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRw�s(RR	R
R1RvRURw(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRuks
	t
NoArgsCommandcBs&eZdZdZd�Zd�ZRS(u8
    A command which takes no arguments on the command line.

    Rather than implementing ``handle()``, subclasses must implement
    ``handle_noargs()``; ``handle()`` itself is overridden to ensure
    no arguments are passed to the command.

    Attempting to pass arguments will raise ``CommandError``.

    ucOs"|rtd��n|j|�S(Nu$Command doesn't accept any arguments(Rt
handle_noargs(RR1R((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRU�scKs
t��dS(u2
        Perform this command's actions.

        N(Rg(RR((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyR{�s(RR	R
R1RUR{(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyRz�s
	(R
t
__future__RRRtoptparseRRR/tdjango.core.exceptionsRtdjango.core.management.colorRtdjango.utils.encodingRtdjango.utils.sixRR>RRtobjectRR'RjRuRz(((s=/tmp/pip-install-XxeQeY/django/django/core/management/base.pyt<module>s 	
�$$

https://t.me/AnonymousX5 - 2025