B
    æ¹`3  ã               @   sf   d dl Z ddlmZ ee jƒG dd„ deƒƒZee jƒG dd„ deƒƒZee jƒG dd	„ d	eƒƒZdS )
é    Né   )Úadd_metaclassc               @   s>   e Zd ZdZejdd„ ƒZejd	dd„ƒZejd
dd„ƒZdS )ÚILoaderaÑ  
    An abstraction over an source of configuration settings.

    It is required to implement ``get_sections``, ``get_settings`` and
    ``setup_logging``.

    Optionally, it may also implement other :term:`loader protocol` interfaces
    to provide extra functionality. For example,
    :class:`plaster.protocols.IWSGIProtocol` which requires ``get_wsgi_app``,
    and ``get_wsgi_server`` for loading WSGI configurations. Services that
    depend on such functionality should document the required functionality
    behind a particular :term:`loader protocol` which custom loaders can
    implement.

    :ivar uri: The :class:`plaster.PlasterURL` object used to find the
        :class:`plaster.ILoaderFactory`.

    c             C   s   dS )z<
        Load the list of section names available.

        N© )Úselfr   r   úZ/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/plaster/interfaces.pyÚget_sections   s    zILoader.get_sectionsNc             C   s   dS )aQ  
        Load the settings for the named ``section``.

        :param section: The name of the section in the config file. If this is
            ``None`` then it is up to the loader to determine a sensible
            default usually derived from the fragment in the ``path#name``
            syntax of the ``config_uri``.

        :param defaults: A ``dict`` of default values used to populate the
            settings and support variable interpolation. Any values in
            ``defaults`` may be overridden by the loader prior to returning
            the final configuration dictionary.

        :returns: A ``dict`` of settings. This should return a dictionary
            object even if the section is missing.
        :raises ValueError: If a section name is missing and cannot be
            determined from the ``config_uri``.

        Nr   )r   ÚsectionÚdefaultsr   r   r   Úget_settings"   s    zILoader.get_settingsc             C   s   dS )a+  
        Execute the logging configuration defined in the config file.

        This function should, at least, configure the Python standard logging
        module. However, it may also be used to configure any other logging
        subsystems that serve a similar purpose.

        :param defaults: A ``dict`` of default values used to populate the
            settings and support variable interpolation. Any values in
            ``defaults`` may be overridden by the loader prior to returning
            the final configuration dictionary.

        Nr   )r   r
   r   r   r   Úsetup_logging8   s    zILoader.setup_logging)NN)N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚabcÚabstractmethodr   r   r   r   r   r   r   r      s   r   c               @   s   e Zd Zejdd„ ƒZdS )ÚILoaderFactoryc             C   s   dS )z
        A factory which accepts a :class:`plaster.PlasterURL` and returns a
        :class:`plaster.ILoader` object.

        Nr   )r   Úurir   r   r   Ú__call__K   s    zILoaderFactory.__call__N)r   r   r   r   r   r   r   r   r   r   r   I   s   r   c               @   s   e Zd ZdZejdd„ ƒZdS )ÚILoaderInfoa  
    An info object describing a specific :class:`plaster.ILoader`.

    :ivar scheme: The full scheme of the loader.
    :ivar protocols: Zero or more supported :term:`loader protocol`
        identifiers.
    :ivar factory: The :class:`plaster.ILoaderFactory`.

    c             C   s   dS )z¬
        Create and return an :class:`plaster.ILoader` instance.

        :param config_uri: Anything that can be parsed by
            :func:`plaster.parse_uri`.

        Nr   )r   Z
config_urir   r   r   Úload`   s    zILoaderInfo.loadN)r   r   r   r   r   r   r   r   r   r   r   r   T   s   
r   )r   Úcompatr   ÚABCMetaÚobjectr   r   r   r   r   r   r   Ú<module>   s   B
