ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@sVdZddlmZddlmZdefdYZdefdYZdS( sDeprecated core event interfaces. .. deprecated:: 0.7 As of SQLAlchemy 0.7, the new event system described in :ref:`event_toplevel` replaces the extension/proxy/listener system, providing a consistent interface to all events without the need for subclassing. i(tevent(tutilt PoolListenercBsAeZdZedZdZdZdZdZRS(s Hooks into the lifecycle of connections in a :class:`.Pool`. .. deprecated:: 0.7 :class:`.PoolListener` is deprecated and will be removed in a future release. Please refer to :func:`.event.listen` in conjunction with the :class:`.PoolEvents` listener interface. Usage:: class MyListener(PoolListener): def connect(self, dbapi_con, con_record): '''perform connect operations''' # etc. # create a new pool with a listener p = QueuePool(..., listeners=[MyListener()]) # add a listener after the fact p.add_listener(MyListener()) # usage with create_engine() e = create_engine("url://", listeners=[MyListener()]) All of the standard connection :class:`~sqlalchemy.pool.Pool` types can accept event listeners for key connection lifecycle events: creation, pool check-out and check-in. There are no events fired when a connection closes. For any given DB-API connection, there will be one ``connect`` event, `n` number of ``checkout`` events, and either `n` or `n - 1` ``checkin`` events. (If a ``Connection`` is detached from its pool via the ``detach()`` method, it won't be checked back in.) These are low-level events for low-level objects: raw Python DB-API connections, without the conveniences of the SQLAlchemy ``Connection`` wrapper, ``Dialect`` services or ``ClauseElement`` execution. If you execute SQL through the connection, explicitly closing all cursors and other resources is recommended. Events also receive a ``_ConnectionRecord``, a long-lived internal ``Pool`` object that basically represents a "slot" in the connection pool. ``_ConnectionRecord`` objects have one public attribute of note: ``info``, a dictionary whose contents are scoped to the lifetime of the DB-API connection managed by the record. You can use this shared storage area however you like. There is no need to subclass ``PoolListener`` to handle events. Any class that implements one or more of these methods can be used as a pool listener. The ``Pool`` will inspect the methods provided by a listener object and add the listener to one or more internal event queues based on its capabilities. In terms of efficiency and function call overhead, you're much better off only providing implementations for the hooks you'll be using. cCs6ddddg}tj|d|}xh|D]`}tt|}t||d}|dk r.tj|| r.tjd||fq.q.Wt|drtj |d|j nt|drtj |d|j nt|dr tj |d|j nt|dr2tj |d|j ndS(s^Adapt a :class:`.PoolListener` to individual :class:`event.Dispatch` events. tconnectt first_connecttcheckouttcheckintmethodssPoolListener.%s is deprecated. The PoolListener class will be removed in a future release. Please transition to the @event interface, using @event.listens_for(Engine, '%s').N(Rt as_interfacetgetattrRtNonetmethods_equivalenttwarn_deprecatedthasattrRtlistenRRRR(tclstselftlistenerRtmethtme_methtls_meth((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyt_adapt_listenerRs$  cCsdS(s(Called once for each new DB-API connection or Pool's ``creator()``. dbapi_con A newly connected raw DB-API connection (not a SQLAlchemy ``Connection`` wrapper). con_record The ``_ConnectionRecord`` that persistently manages the connection N((Rt dbapi_cont con_record((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRstcCsdS(sCalled exactly once for the first DB-API connection. dbapi_con A newly connected raw DB-API connection (not a SQLAlchemy ``Connection`` wrapper). con_record The ``_ConnectionRecord`` that persistently manages the connection N((RRR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRRcCsdS(sCCalled when a connection is retrieved from the Pool. dbapi_con A raw DB-API connection con_record The ``_ConnectionRecord`` that persistently manages the connection con_proxy The ``_ConnectionFairy`` which manages the connection for the span of the current checkout. If you raise an ``exc.DisconnectionError``, the current connection will be disposed and a fresh connection retrieved. Processing of all checkout listeners will abort and restart using the new connection. N((RRRt con_proxy((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRRcCsdS(sCalled when a connection returns to the pool. Note that the connection may be closed, and may be None if the connection has been invalidated. ``checkin`` will not be called for detached connections. (They do not return to the pool.) dbapi_con A raw DB-API connection con_record The ``_ConnectionRecord`` that persistently manages the connection N((RRR((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRR( t__name__t __module__t__doc__t classmethodRRRRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRs 8! tConnectionProxycBseZdZedZdZdZdZdZdZ ddZ dZ d Z d Zd Zd Zd ZRS(s7Allows interception of statement execution by Connections. .. deprecated:: 0.7 :class:`.ConnectionProxy` is deprecated and will be removed in a future release. Please refer to :func:`.event.listen` in conjunction with the :class:`.ConnectionEvents` listener interface. Either or both of the ``execute()`` and ``cursor_execute()`` may be implemented to intercept compiled statement and cursor level executions, e.g.:: class MyProxy(ConnectionProxy): def execute(self, conn, execute, clauseelement, *multiparams, **params): print "compiled statement:", clauseelement return execute(clauseelement, *multiparams, **params) def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): print "raw statement:", statement return execute(cursor, statement, parameters, context) The ``execute`` argument is a function that will fulfill the default execution behavior for the operation. The signature illustrated in the example should be used. The proxy is installed into an :class:`~sqlalchemy.engine.Engine` via the ``proxy`` argument:: e = create_engine('someurl://', proxy=MyProxy()) c sddddddddd d d d g }xX|D]P}tt|}t|}tj||s1tjd ||fq1q1Wfd}tj|d|fd}tj|d|dfd} tj|d| jtj|d| jtj|d| j tj|d| j tj|d| j tj|d| j tj|d | j tj|d | jtj|d | jtj|d | jdS(Ntexecutetcursor_executetbegintrollbacktcommitt savepointtrollback_savepointtrelease_savepointtbegin_twophasetprepare_twophasetrollback_twophasetcommit_twophasesConnectionProxy.%s is deprecated. The ConnectionProxy class will be removed in a future release. Please transition to the @event interface, using @event.listens_for(Engine, '%s').cs"d}j|||||S(Nc_s |||fS(N((t clauseelementt multiparamstparams((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pytexecute_wrappers(R(tconnR+R,R-R.(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyt adapt_executes tbefore_executecs%d}j||||||S(NcSs ||fS(N((tcursort statementt parameterstcontext((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR.s(R (R/R2R3R4R5t executemanyR.(R(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pytadapt_cursor_executes tbefore_cursor_executec_sdS(N((targtkw((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pytdo_nothing_callback scs"fd}tj|S(Ncs|||dS(N((R/R9R:(R;tfn(sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pytgo s(Rtupdate_wrapper(R<R=(R;(R<sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pytadapt_listener s(R RRR R RRR!R"R#R$R%R&R'R(R)R*( RRRRRRRR0R7R?((R;RsH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRs^   cOs||||S(s&Intercept high level execute() events.((RR/RR+R,R-((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR/scCs|||||S(s,Intercept low-level cursor execute() events.((RRR2R3R4R5R6((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR 4scCs|S(sIntercept begin() events.((RR/R!((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR!;scCs|S(sIntercept rollback() events.((RR/R"((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR"@scCs|S(sIntercept commit() events.((RR/R#((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR#EscCs |d|S(sIntercept savepoint() events.tname((RR/R$R@((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR$JscCs |||S(s&Intercept rollback_savepoint() events.((RR/R%R@R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR%OscCs |||S(s%Intercept release_savepoint() events.((RR/R&R@R5((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR&TscCs ||S(s"Intercept begin_twophase() events.((RR/R'txid((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR'YscCs ||S(s$Intercept prepare_twophase() events.((RR/R(RA((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR(^scCs |||S(s%Intercept rollback_twophase() events.((RR/R)RAt is_prepared((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR)cscCs |||S(s#Intercept commit_twophase() events.((RR/R*RARB((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyR*hsN(RRRRRRR R!R"R#R R$R%R&R'R(R)R*(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyRs!^           N(RRRRtobjectRR(((sH/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/interfaces.pyts