File: //opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyo
�
a�Nc           @   s  d  Z  d d l m Z d d l m Z d e f d �  �  YZ d e f d �  �  YZ d e f d	 �  �  YZ d
 �  Z	 d d g Z
 d e k r� e r� d d
 l
 m Z e e d d �Z e �  Z e j �  Z e j d e j d � � e j �  \ Z Z e Ge GHn  d S(   s�   
Middleware related to transactions and database connections.
At this time it is very basic; but will eventually sprout all that
two-phase commit goodness that I don't need.
.. note::
   This is experimental, and will change in the future.
i����(   t
   HTTPException(   t   catch_errorst   TransactionManagerMiddlewarec           B   s   e  Z d  �  Z d �  Z RS(   c         C   s
   | |  _  d  S(   N(   t   application(   t   selfR   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt   __init__   s    c         C   s@   t  �  | d <} t | d <t |  j | | d | j d | j �S(   Ns   paste.transaction_managers   paste.throw_errorst   error_callbackt   ok_callback(   t   Managert   TrueR   R   t   errort   finish(   R   t   environt   start_responset   manager(    (    sB   /opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt   __call__   s
    
	(   t   __name__t
   __module__R   R   (    (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR      s   	R   c           B   s,   e  Z d  �  Z d �  Z d �  Z d �  Z RS(   c         C   s   t  |  _ g  |  _ d  S(   N(   t   Falset   abortedt   transactions(   R   (    (    sB   /opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR   "