%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyo

�
��4]c@sTdZddlZddlmZddlmZddlmZddlmZddlm	Z
dd	lmZdd
l
mZddl
mZddl
mZdd
l
mZddl
mZdZd�ZegZdefd��YZe�e_Zee_defd��YZdefd��YZd�Zd�Zd�ZdS(s�Extensible class instrumentation.

The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM.  Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed
on the class.

.. note::
    The extension package is provided for the benefit of integration
    with other object management packages, which already perform
    their own instrumentation.  It is not intended for general use.

For examples of how the instrumentation extension is used,
see the example :ref:`examples_instrumentation`.

i����Ni(tutil(t
attributes(tbase(tcollections(texc(tinstrumentation(t_default_dict_getter(t_default_manager_getter(t_default_state_getter(tClassManager(tInstrumentationFactoryt__sa_instrumentation_manager__cCst|td�S(s;Find user-specified instrumentation management for a class.N(tgetattrtINSTRUMENTATION_MANAGERtNone(tcls((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt%find_native_user_instrumentation_hook;stExtendedInstrumentationRegistrycBs�eZdZej�Zej�Zej�ZeZ	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�ZRS(	s�Extends :class:`.InstrumentationFactory` with additional
    bookkeeping, to accommodate multiple types of
    class managers.

    cCsMxFtD]:}||�}|dk	r|j||�}||fSqWdSdS(N(NN(tinstrumentation_findersRt_extended_class_manager(tselftclass_tfindertfactorytmanager((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt_locate_extended_factory]s
cCsG|j|�j|g�}|rCtd|jt|�f��ndS(NsRmultiple instrumentation implementations specified in %s inheritance hierarchy: %r(t!_collect_management_factories_fort
differencet	TypeErrort__name__tlist(RRRtexisting_factories((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt_check_conflictsfs	cCs�||�}t|t�s-t||�}n|tkrV|jrVt|_t�n|j�|j|<|j�|j	|<|j
�|j|<|S(N(t
isinstanceR	t_ClassInstrumentationAdaptert	_extendedtTruet_install_instrumented_lookupstmanager_gettert_manager_finderststate_gettert_state_finderstdict_gettert
_dict_finders(RRRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRqs	
cCs�tj|�}t�}x||D]t}|j|�}|dk	rS|j|j�qx0tD]"}||�}|dk	rZPqZqZWd}|j|�qW|jd�|S(scReturn a collection of factories in play or specified for a
        hierarchy.

        Traverses the entire inheritance graph of a cls and returns a
        collection of instrumentation factories for those classes. Factories
        are extracted from active ClassManagers, if available, otherwise
        instrumentation_finders is consulted.

        N(	Rtclass_hierarchytsettmanager_of_classRtaddRRtdiscard(RRt	hierarchyt	factoriestmemberRRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR�s
	


cCsJ||jkr0|j|=|j|=|j|=ntt|�j|�dS(N(R'R)R+tsuperRt
unregister(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR5�s



cCsL|dkrdSy|jj|t�}Wntk
r=dSX||�SdS(N(RR'tgetRR(RRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR.�s
cCs7|dkrtd��n|jj|jt�|�S(NsNone has no persistent state.(RtAttributeErrorR)R6t	__class__R(Rtinstance((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytstate_of�s
	cCs7|dkrtd��n|jj|jt�|�S(NsNone has no persistent state.(RR7R+R6R8R(RR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytdict_of�s
	(Rt
__module__t__doc__tweakreftWeakKeyDictionaryR'R)R+tFalseR#RR RRR5R.R:R;(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRQs								tInstrumentationManagercBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�ZRS(sWUser-defined class instrumentation extension.

    :class:`.InstrumentationManager` can be subclassed in order
    to change
    how class instrumentation proceeds. This class exists for
    the purposes of integration with other object management
    frameworks which would like to entirely modify the
    instrumentation methodology of the ORM, and is not intended
    for regular usage.  For interception of class instrumentation
    events, see :class:`.InstrumentationEvents`.

    The API for this class should be considered as semi-stable,
    and may change slightly with new releases.

    cCsdS(N((RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt__init__�scCst|d|�dS(Nt_default_class_manager(tsetattr(RRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytmanage�scCst|d�dS(NRC(tdelattr(RRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytdispose�scCs
d�}|S(NcSs|jS(N(RC(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR6�s((RRR6((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR&�s	cCsdS(N((RRtkeytinst((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstrument_attribute�scCsdS(N((RRRHRI((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytpost_configure_attribute�scCst|||�dS(N(RD(RRRHRI((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstall_descriptor�scCst||�dS(N(RF(RRRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytuninstall_descriptor�scCst|||�dS(N(RD(RRRHtimplementation((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstall_member�scCst||�dS(N(RF(RRRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytuninstall_member�scCs
tj|�S(N(Rtprepare_instrumentation(RRRHtcollection_class((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstrument_collection_class�scCs|jS(N(t__dict__(RRR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytget_instance_dict�scCsdS(N((RRR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinitialize_instance_dictscCst|d|�dS(Nt_default_state(RD(RRR9tstate((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt
install_statescCst|d�dS(NRW(RF(RRR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytremove_statescCsd�S(NcSs
t|d�S(NRW(R(R9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt<lambda>
t((RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR(	scs��fd�S(Ncs�j�|�S(N(RU(RI(RR(sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR[
R\((RR((RRsQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR*s(RR<R=RBRERGR&RJRKRLRMRORPRSRURVRYRZR(R*(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRA�s$																R"cBs�eZdZd�Zd�Zd�Zd�Zed�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zdd
�Zd�Zdd�Zd�Zd�Zd�Zd�ZRS(s?Adapts a user-defined InstrumentationManager to a ClassManager.cCsG||_|jj|�|_|jj|�|_tj||�dS(N(t_adaptedR(t
_get_stateR*t	_get_dictR	RB(RRtoverride((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRBs	cCs|jj|j|�dS(N(R]RER(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyREscCs|jj|j�dS(N(R]RGR(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRGscCs|jj|j�S(N(R]R&R(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR& scCs<tj||||�|s8|jj|j||�ndS(N(R	RJR]R(RRHRIt
propagated((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRJ#scCs7tt|�j|�|jj|j|||�dS(N(R4R"RKR]R(RRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRK(scCs|jj|j||�dS(N(R]RLR(RRHRI((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRL,scCs|jj|j|�dS(N(R]RMR(RRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRM/scCs|jj|j||�dS(N(R]ROR(RRHRN((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRO2scCs|jj|j|�dS(N(R]RPR(RRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRP5scCs|jj|j||�S(N(R]RSR(RRHRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRS8s	cCsEt|jdd�}|r+||||�Stj||||�SdS(Ntinitialize_collection(RR]RR	Rb(RRHRXRtdelegate((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRb=s
cCs)|jj|j�}|j||�|S(N(Rt__new__tsetup_instance(RRXR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytnew_instanceFscCs$|j|�rtS|j|�SdS(s�Install a default InstanceState if none is present.

        A private convenience method used by the __init__ decorator.
        N(t	has_stateR@Re(RR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt_new_state_if_noneKscCsT|jj|j|�|dkr7|j||�}n|jj|j||�|S(N(R]RVRRt_state_constructorRY(RR9RX((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyReUs
cCs|jj|j|�dS(N(R]RZR(RR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytteardown_instance_scCs1y|j|�Wntjk
r(tSXtSdS(N(R^torm_exctNO_STATER@R$(RR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRgbs
cCs|jS(N(R^(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR(jscCs|jS(N(R_(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR*msN(RR<R=RBRERGR&R@RJRKRLRMRORPRSRbRRfRhReRjRgR(R*(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR"s(													

			cCs,ttdtjdtjdtj��dS(s�Replace global class/object management functions
    with ExtendedInstrumentationRegistry implementations, which
    allow multiple types of class managers to be present,
    at the cost of performance.

    This function is called only by ExtendedInstrumentationRegistry
    and unit tests specific to this behavior.

    The _reinstall_default_lookups() function can be called
    after this one to re-establish the default functions.

    tinstance_statet
instance_dictR.N(t_install_lookupstdictt_instrumentation_factoryR:R;R.(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR%qs

		cCs,ttdtdtdt��tt_dS(sRestore simplified lookups.RmRnR.N(RoRpRRRR@RqR#(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt_reinstall_default_lookups�s
cCsg|da|da|datt_t_t_tt_t_t_tt_t_t_dS(NRmRnR.(RmRnR.torm_baseRtorm_instrumentation(tlookups((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRo�s


(R=R>R\RtormRRRsRRRkRRttorm.instrumentationRRRR	R
R
RRRRqtobjectRAR"R%RrRo(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt<module>s.		o	La		

Zerion Mini Shell 1.0