Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / sqlalchemy / interfaces.pyc
Size: Mime:
ó
‹EYc@sLdZddlmZmZdefd„ƒYZdefd„ƒYZdS(siDeprecated core event interfaces.

This module is **deprecated** and is superseded by the
event system.

i(teventtutiltPoolListenercBsAeZdZed„ƒZd„Zd„Zd„Zd„ZRS(s,	Hooks into the lifecycle of connections in a :class:`.Pool`.

    .. note::

       :class:`.PoolListener` is deprecated.   Please
       refer to :class:`.PoolEvents`.

    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.

    cCs¹tj|ddƒ}t|dƒr=tj|d|jƒnt|dƒretj|d|jƒnt|dƒrtj|d|jƒnt|dƒrµtj|d|jƒndS(s^Adapt a :class:`.PoolListener` to individual
        :class:`event.Dispatch` events.

        tmethodstconnectt
first_connecttcheckouttcheckinN(sconnects
first_connectscheckoutscheckin(	Rtas_interfacethasattrRtlistenRRRR(tclstselftlistener((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyt_adapt_listenerLs	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((Rt	dbapi_cont
con_record((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR_scCsdS(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((RRR((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRkscCsdS(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((RRRt	con_proxy((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRwscCsdS(s£Called 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((RRR((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRŠs(	t__name__t
__module__t__doc__tclassmethodRRRRR(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRs7			tConnectionProxycBsŒeZdZed„ƒZd„Zd„Zd„Zd„Zd„Z	dd„Zd„Zd	„Z
d
„Zd„Zd„Zd
„ZRS(s¾Allows interception of statement execution by Connections.

    .. note::

       :class:`.ConnectionProxy` is deprecated.   Please
       refer to :class:`.ConnectionEvents`.

    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())

    csx‡fd†}tj|d|ƒ‡fd†}tj|d|ƒd„‰‡fd†}tj|d|ˆjƒƒtj|d|ˆjƒƒtj|d	|ˆjƒƒtj|d
|ˆjƒƒtj|d|ˆjƒƒtj|d|ˆjƒƒtj|d
|ˆjƒƒtj|d|ˆj	ƒƒtj|d|ˆj
ƒƒtj|d|ˆjƒƒdS(Ncs"d„}ˆj|||||ŽS(Nc_s
|||fS(N((t
clauseelementtmultiparamstparams((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pytexecute_wrapperÁs(texecute(tconnRRRR(R
(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyt
adapt_execute¿s	tbefore_executecs%d„}ˆj||||||ƒS(NcSs
||fS(N((tcursort	statementt
parameterstcontext((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRÍs(tcursor_execute(RRR R!R"texecutemanyR(R
(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pytadapt_cursor_executeÊs	tbefore_cursor_executec_sdS(N((targtkw((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pytdo_nothing_callbackàscs"‡‡fd†}tj|ˆƒS(Ncsˆ|ˆ||ŽdS(N((RR'R((R)tfn(sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pytgoås(Rtupdate_wrapper(R*R+(R)(R*sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pytadapt_listenerãstbegintrollbacktcommitt	savepointtrollback_savepointtrelease_savepointtbegin_twophasetprepare_twophasetrollback_twophasetcommit_twophase(RR
R.R/R0R1R2R3R4R5R6R7(RRR
RR%R-((R)R
sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR¼s0		cOs||||ŽS(s&Intercept high level execute() events.((RRRRRR((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRýscCs|||||ƒS(s,Intercept low-level cursor execute() events.((RRRR R!R"R$((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR#scCs|ƒS(sIntercept begin() events.((RRR.((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR.scCs|ƒS(sIntercept rollback() events.((RRR/((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR/
scCs|ƒS(sIntercept commit() events.((RRR0((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR0scCs
|d|ƒS(sIntercept savepoint() events.tname((RRR1R8((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR1scCs
|||ƒS(s&Intercept rollback_savepoint() events.((RRR2R8R"((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR2scCs
|||ƒS(s%Intercept release_savepoint() events.((RRR3R8R"((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR3!scCs
||ƒS(s"Intercept begin_twophase() events.((RRR4txid((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR4&scCs
||ƒS(s$Intercept prepare_twophase() events.((RRR5R9((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR5+scCs
|||ƒS(s%Intercept rollback_twophase() events.((RRR6R9tis_prepared((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR60scCs
|||ƒS(s#Intercept commit_twophase() events.((RRR7R9R:((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyR75sN(RRRRRRR#R.R/R0tNoneR1R2R3R4R5R6R7(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyRšs A										N(RtRRtobjectRR(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/interfaces.pyt<module>s‡