
    0h3                        S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJ	r	  \R                  (       a
  S SKrSSKJr  \R                  " S5      r " S S\R"                  \   5      r " S	 S
\5      rg)    )annotationsN)import_string   )AppTc                      \ rS rSrSr S
     SS jjr\R                  SS j5       r\R                  SS j5       rS
SS jjrSS jr	S	r
g)ConfigAttribute   z(Makes an attribute forward to the configNc                    Xl         X l        g N__name__get_converter)selfnamer   s      D/var/www/auris/envauris/lib/python3.13/site-packages/flask/config.py__init__ConfigAttribute.__init__   s     *    c                    g r    r   objowners      r   __get__ConfigAttribute.__get__   s    :=r   c                    g r   r   r   s      r   r   r       s    8;r   c                ~    Uc  U $ UR                   U R                     nU R                  b  U R                  U5      nU$ r   )configr   r   )r   r   r   rvs       r   r   r   #   s?    ;KZZ&)##B'B	r   c                4    X!R                   U R                  '   g r   )r   r   )r   r   values      r   __set__ConfigAttribute.__set__.   s    $)

4==!r   r   r   )r   strr   zt.Callable[[t.Any], T] | NonereturnNone)r   r'   r   r'   r&   zte.Self)r   r   r   z	type[App]r&   r   )r   z
App | Noner   ztype[App] | Noner&   zT | te.Self)r   r   r"   t.Anyr&   r'   )r   
__module____qualname____firstlineno____doc__r   toverloadr   r#   __static_attributes__r   r   r   r	   r	      sY    2 IM++(E+	+ ZZ= =ZZ; ;	*r   r	   c                    ^  \ rS rSrSr S     SU 4S jjjrSSS jjr S\R                  S.     SS jjjr	 S     SS jjr
SS jr  S         SS	 jjr S     SS
 jjr S       SS jjrSS jrSrU =r$ )Config2   aa  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
c                B   > [         TU ]  U=(       d    0 5        Xl        g r   )superr   	root_path)r   r5   defaults	__class__s      r   r   Config.__init__^   s    
 	R("r   c                    [         R                  R                  U5      nU(       d  U(       a  g[        SU< S35      eU R	                  X2S9$ )a  Loads 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: ``True`` if the file was loaded successfully.
FzThe environment variable zv is not set and as such configuration could not be loaded. Set this variable and make it point to a configuration file)silent)osenvirongetRuntimeErrorfrom_pyfile)r   variable_namer:   r    s       r   from_envvarConfig.from_envvarf   sT     ZZ^^M*+M+< =   22r   )loadsc               n   U S3n[        [        R                  5       H  nUR                  U5      (       d  M  [        R                  U   nUR	                  U5      n U" U5      nSU;  a  X@U'   MT  U nUR                  S5      Gt pgU H  nX;  a  0 XX'   XX   nM     XEU'   M     g! [
         a     NLf = f)a~  Load any environment variables that start with ``FLASK_``,
dropping the prefix from the env key for the config key. Values
are passed through a loading function to attempt to convert them
to more specific types than strings.

Keys are loaded in :func:`sorted` order.

The default loading function attempts to parse values as any
valid JSON type, including dicts and lists.

Specific items in nested dicts can be set by separating the
keys with double underscores (``__``). If an intermediate key
doesn't exist, it will be initialized to an empty dict.

:param prefix: Load env vars that start with this prefix,
    separated with an underscore (``_``).
:param loads: Pass each string value to this function and use
    the returned value as the config value. If any error is
    raised it is ignored and the value remains a string. The
    default is :func:`json.loads`.

.. versionadded:: 2.1
___T)sortedr;   r<   
startswithremoveprefix	Exceptionsplit)	r   prefixrC   keyr"   currentpartstailparts	            r   from_prefixed_envConfig.from_prefixed_env~   s    4 81"**%C>>&))JJsOE""6*Ce
 3!S	 G99T?LU&$&GM!-  "DM; &> -  s   B''
B43B4c                <   [         R                  R                  U R                  U5      n[        R
                  " S5      nXl         [        USS9 n[        [        UR                  5       US5      UR                  5        SSS5        U R%                  U5        g	! , (       d  f       N = f! [         ad  nU(       aB  UR                  [        R                  [        R                  [        R                   4;   a   SnAgSUR"                   S3Ul        e SnAff = f)
a  Updates 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.
:return: ``True`` if the file was loaded successfully.

.. versionadded:: 0.7
   `silent` parameter.
r   rb)modeexecNF#Unable to load configuration file ()T)r;   pathjoinr5   types
ModuleType__file__openrW   compileread__dict__OSErrorerrnoENOENTEISDIRENOTDIRstrerrorfrom_object)r   filenamer:   dconfig_filees         r   r?   Config.from_pyfile   s    " 77<<9X&
	hT*kW[--/6BAJJO + 	 +* 	!''ellELL%--%PP>qzzl!LAJ		s=   
B- 0BB- 
B*&B- *B- -
D7AD DDc                    [        U[        5      (       a  [        U5      n[        U5       H'  nUR	                  5       (       d  M  [        X5      X'   M)     g)a  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)
isinstancer%   r   dirisuppergetattr)r   r   rM   s      r   ri   Config.from_object   sA    @ c3$Cs8C{{}}#C-	 r   c                   [         R                  R                  U R                  U5      n [	        X(       a  SOS5       nU" U5      nSSS5        U R                  W5      $ ! , (       d  f       N= f! [
         aU  nU(       a3  UR                  [        R                  [        R                  4;   a   SnAgSUR                   S3Ul	        e SnAff = f)a  Update the values in the config from a file that is loaded
using the ``load`` parameter. The loaded data is passed to the
:meth:`from_mapping` method.

.. code-block:: python

    import json
    app.config.from_file("config.json", load=json.load)

    import tomllib
    app.config.from_file("config.toml", load=tomllib.load, text=False)

:param filename: The path to the data file. This can be an
    absolute path or relative to the config root path.
:param load: A callable that takes a file handle and returns a
    mapping of loaded data from the file.
:type load: ``Callable[[Reader], Mapping]`` where ``Reader``
    implements a ``read`` method.
:param silent: Ignore the file if it doesn't exist.
:param text: Open the file in text or binary mode.
:return: ``True`` if the file was loaded successfully.

.. versionchanged:: 2.3
    The ``text`` parameter was added.

.. versionadded:: 2.0
rrU   NFrX   rY   )r;   rZ   r[   r5   r_   rc   rd   re   rf   rh   from_mapping)r   rj   loadr:   textfr   rm   s           r   	from_fileConfig.from_file   s    D 77<<9	ht6!1g 7   %% 76 	!''ellELL%AA>qzzl!LAJ	s;   A3  	A"	A3 "
A0,A3 0A3 3
C=5C7CCc                    0 nUb  UR                  U5        UR                  U5        UR                  5        H   u  pEUR                  5       (       d  M  XPU'   M"     g)zUpdates the config like :meth:`update` ignoring items with
non-upper keys.

:return: Always returns ``True``.

.. versionadded:: 0.11
T)updateitemsrr   )r   mappingkwargsmappingsrM   r"   s         r   rw   Config.from_mapping0  sQ     &(OOG$"..*JC{{}}!S	 + r   c                    0 nU R                  5        HP  u  pVUR                  U5      (       d  M  U(       a  U[        U5      S nOUnU(       a  UR                  5       nXdU'   MR     U$ )a  Returns 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
N)r   rH   lenlower)r   	namespace	lowercasetrim_namespacer    kvrM   s           r   get_namespaceConfig.get_namespaceC  sb    < JJLDA<<	**I()iiksG ! 	r   c                `    S[        U 5      R                   S[        R                  U 5       S3$ )N< >)typer   dict__repr__)r   s    r   r   Config.__repr__n  s,    4:&&'qt)<(=Q??r   )r5   r   )r5   str | os.PathLike[str]r6   zdict[str, t.Any] | Noner&   r'   )F)r@   r%   r:   boolr&   r   )FLASK)rL   r%   rC   zt.Callable[[str], t.Any]r&   r   )rj   r   r:   r   r&   r   )r   zobject | strr&   r'   )FT)
rj   r   rx   z0t.Callable[[t.IO[t.Any]], t.Mapping[str, t.Any]]r:   r   ry   r   r&   r   )r   zt.Mapping[str, t.Any] | Noner   r(   r&   r   )TT)r   r%   r   r   r   r   r&   zdict[str, t.Any])r&   r%   )r   r)   r*   r+   r,   r   rA   jsonrC   rR   r?   ri   r{   rw   r   r   r/   __classcell__)r7   s   @r   r1   r1   2   s+   )\ -1#)# *# 
	# #32 $;JN**;;/G;	;| @E.8<	>$.T .&(.& ?.& 	.&
 .& 
.&b 7;3FK	( NR)))-)FJ)	)V@ @r   r1   )
__future__r   rd   r   r;   r\   typingr-   werkzeug.utilsr   TYPE_CHECKINGtyping_extensionste
sansio.appr   TypeVarr   Genericr	   r   r1   r   r   r   <module>r      sZ    "   	   (??" IIcN*aiil *<}@T }@r   