B
    ‰KLc  ã               @   s8   d dl Z ddlmZ G dd„ deƒZG dd„ deƒZdS )é    Né   )ÚABCc               @   sB   e Zd ZdZdZdZejdd„ ƒZejdd„ ƒZ	ejdd	„ ƒZ
d
S )ÚConnectionCharacteristica÷  An abstract base for an object that can set, get and reset a
    per-connection characteristic, typically one that gets reset when the
    connection is returned to the connection pool.

    transaction isolation is the canonical example, and the
    ``IsolationLevelCharacteristic`` implementation provides this for the
    ``DefaultDialect``.

    The ``ConnectionCharacteristic`` class should call upon the ``Dialect`` for
    the implementation of each method.   The object exists strictly to serve as
    a dialect visitor that can be placed into the
    ``DefaultDialect.connection_characteristics`` dictionary where it will take
    effect for calls to :meth:`_engine.Connection.execution_options` and
    related APIs.

    .. versionadded:: 1.4

    © Fc             C   s   dS )z@Reset the characteristic on the connection to its default value.Nr   )ÚselfÚdialectÚ
dbapi_connr   r   ú@lib/python3.7/site-packages/sqlalchemy/engine/characteristics.pyÚreset_characteristic   s    z-ConnectionCharacteristic.reset_characteristicc             C   s   dS )z6set characteristic on the connection to a given value.Nr   )r   r   r   Úvaluer   r   r	   Úset_characteristic"   s    z+ConnectionCharacteristic.set_characteristicc             C   s   dS )zXGiven a DBAPI connection, get the current value of the
        characteristic.

        Nr   )r   r   r   r   r   r	   Úget_characteristic&   s    z+ConnectionCharacteristic.get_characteristicN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚtransactionalÚabcÚabstractmethodr
   r   r   r   r   r   r	   r      s   r   c               @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚIsolationLevelCharacteristicTc             C   s   |  |¡ d S )N)Zreset_isolation_level)r   r   r   r   r   r	   r
   1   s    z1IsolationLevelCharacteristic.reset_characteristicc             C   s   |  ||¡ d S )N)Zset_isolation_level)r   r   r   r   r   r   r	   r   4   s    z/IsolationLevelCharacteristic.set_characteristicc             C   s
   |  |¡S )N)Zget_isolation_level)r   r   r   r   r   r	   r   7   s    z/IsolationLevelCharacteristic.get_characteristicN)r   r   r   r   r
   r   r   r   r   r   r	   r   .   s   r   )r   Úutilr   r   r   r   r   r   r	   Ú<module>   s   (