/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event
NameSizeModeActions
api.py62790644editdlrm
api.pyc70560644editdlrm
api.pyo70560644editdlrm
attr.py129940644editdlrm
attr.pyc184920644editdlrm
attr.pyo182240644editdlrm
base.py97600644editdlrm
base.pyc125410644editdlrm
base.pyo125410644editdlrm
legacy.py59040644editdlrm
legacy.pyc62100644editdlrm
legacy.pyo61760644editdlrm
registry.py80660644editdlrm
registry.pyc76510644editdlrm
registry.pyo76100644editdlrm
__init__.py5960644editdlrm
__init__.pyc6250644editdlrm
__init__.pyo6250644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyc (7056B)
σ ΓΜ4]c@@s₯dZddlmZddlmZddlmZddlmZddlm Z e j d ƒZ e j d ƒZ d „Z d „Zd „Zd„Zd„ZdS(s,Public API functions for the event system. i(tabsolute_importi(t _registrars(t _EventKeyi(texc(tutiltCANCELt NO_RETVALcC@s`xYt|D]4}|j|ƒ}|dk r t||||ƒSq Wtjd||fƒ‚dS(Ns"No such event '%s' for target '%s'(Rt _accept_withtNoneRRtInvalidRequestError(ttargett identifiertfntevt_clsttgt((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyt _event_keys  cO@s t|||ƒj||ŽdS(sΩRegister a listener function for the given target. The :func:`.listen` function is part of the primary interface for the SQLAlchemy event system, documented at :ref:`event_toplevel`. e.g.:: from sqlalchemy import event from sqlalchemy.schema import UniqueConstraint def unique_constraint_name(const, table): const.name = "uq_%s_%s" % ( table.name, list(const.columns)[0].name ) event.listen( UniqueConstraint, "after_parent_attach", unique_constraint_name) A given function can also be invoked for only the first invocation of the event using the ``once`` argument:: def on_config(): do_config() event.listen(Mapper, "before_configure", on_config, once=True) .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen` and :func:`.event.listens_for`. .. note:: The :func:`.listen` function cannot be called at the same time that the target event is being run. This has implications for thread safety, and also means an event cannot be added from inside the listener function for itself. The list of events to be run are present inside of a mutable collection that can't be changed during iteration. Event registration and removal is not intended to be a "high velocity" operation; it is a configurational operation. For systems that need to quickly associate and deassociate with events at high scale, use a mutable structure that is handled from inside of a single listener. .. versionchanged:: 1.0.0 - a ``collections.deque()`` object is now used as the container for the list of events, which explicitly disallows collection mutation while the collection is being iterated. .. seealso:: :func:`.listens_for` :func:`.remove` N(Rtlisten(R R R targstkw((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyR"s=c@s‡‡‡‡fd†}|S(sμDecorate a function as a listener for the given target + identifier. The :func:`.listens_for` decorator is part of the primary interface for the SQLAlchemy event system, documented at :ref:`event_toplevel`. e.g.:: from sqlalchemy import event from sqlalchemy.schema import UniqueConstraint @event.listens_for(UniqueConstraint, "after_parent_attach") def unique_constraint_name(const, table): const.name = "uq_%s_%s" % ( table.name, list(const.columns)[0].name ) A given function can also be invoked for only the first invocation of the event using the ``once`` argument:: @event.listens_for(Mapper, "before_configure", once=True) def on_config(): do_config() .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen` and :func:`.event.listens_for`. .. seealso:: :func:`.listen` - general description of event listening c@stˆˆ|ˆˆŽ|S(N(R(R (RR RR (sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pytdecorate…s((R R RRR((RR RR sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyt listens_forbs#cC@st|||ƒjƒdS(s Remove an event listener. The arguments here should match exactly those which were sent to :func:`.listen`; all the event registration which proceeded as a result of this call will be reverted by calling :func:`.remove` with the same arguments. e.g.:: # if a function was registered like this... @event.listens_for(SomeMappedClass, "before_insert", propagate=True) def my_listener_function(*arg): pass # ... it's removed like this event.remove(SomeMappedClass, "before_insert", my_listener_function) Above, the listener function associated with ``SomeMappedClass`` was also propagated to subclasses of ``SomeMappedClass``; the :func:`.remove` function will revert all of these operations. .. versionadded:: 0.9.0 .. note:: The :func:`.remove` function cannot be called at the same time that the target event is being run. This has implications for thread safety, and also means an event cannot be removed from inside the listener function for itself. The list of events to be run are present inside of a mutable collection that can't be changed during iteration. Event registration and removal is not intended to be a "high velocity" operation; it is a configurational operation. For systems that need to quickly associate and deassociate with events at high scale, use a mutable structure that is handled from inside of a single listener. .. versionchanged:: 1.0.0 - a ``collections.deque()`` object is now used as the container for the list of events, which explicitly disallows collection mutation while the collection is being iterated. .. seealso:: :func:`.listen` N(Rtremove(R R R ((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyRŒs1cC@st|||ƒjƒS(s`Return True if the given target/ident/fn is set up to listen. .. versionadded:: 0.9.0 (Rtcontains(R R R ((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyRΐsN(t__doc__t __future__RtbaseRtregistryRtRRtsymbolRRRRRRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/api.pyt s @ * 4