ÿØÿà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@sTdZddlZddlmZddlmZddlmZddlmZddlm Z dd lm Z dd l mZdd l mZdd l mZdd l mZddl mZdZdZegZdefdYZee _Zee _defdYZdefdYZdZdZdZdS(sExtensible 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`. iNi(tutil(t attributes(tbase(t collections(texc(tinstrumentation(t_default_dict_getter(t_default_manager_getter(t_default_state_getter(t ClassManager(tInstrumentationFactoryt__sa_instrumentation_manager__cCst|tdS(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;stExtendedInstrumentationRegistrycBseZdZejZejZejZeZ dZ dZ dZ dZ dZdZdZdZRS( sExtends :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|fndS(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|ts-t||}n|tkrV|j rVt|_tn|j|j|<|j|j |<|j |j |<|S(N( t isinstanceR t_ClassInstrumentationAdaptert _extendedtTruet_install_instrumented_lookupstmanager_gettert_manager_finderst state_gettert_state_finderst dict_gettert _dict_finders(RRRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRqs   cCstj|}t}x||D]t}|j|}|dk rS|j|jqx0tD]"}||}|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.pyRs        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.pyR5s    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|dkrtdn|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_ofs    cCs7|dkrtdn|jj|jt|S(NsNone has no persistent state.(RR7R+R6R8R(RR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytdict_ofs    (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       tInstrumentationManagercBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZRS(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.pytmanagescCst|ddS(NRC(tdelattr(RRR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytdisposescCs d}|S(NcSs|jS(N(RC(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR6s((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_attributescCsdS(N((RRRHRI((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytpost_configure_attributescCst|||dS(N(RD(RRRHRI((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstall_descriptorscCst||dS(N(RF(RRRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytuninstall_descriptorscCst|||dS(N(RD(RRRHtimplementation((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstall_memberscCst||dS(N(RF(RRRH((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytuninstall_memberscCs tj|S(N(Rtprepare_instrumentation(RRRHtcollection_class((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytinstrument_collection_classscCs|jS(N(t__dict__(RRR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pytget_instance_dictscCsdS(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|ddS(NRW(RF(RRR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt remove_statescCsdS(NcSs t|dS(NRW(R (R9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt t((RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyR( scsfdS(Ncsj|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.pyRAs$                R"cBseZdZdZdZdZdZedZdZ dZ dZ d Z d Z d Zd Zdd ZdZddZdZdZdZdZRS(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|jdS(N(R]RGR(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyRGscCs|jj|jS(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(sInstall 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,ttdtjdtjdtjdS(sReplace 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,ttdtdtdttt_dS(sRestore simplified lookups.RmRnR.N(RoRpRRRR@RqR#(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyt_reinstall_default_lookupss  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.pyRos    (R=R>R\RtormRRRsRRRkRRttorm.instrumentationRRRR R R RRRRqtobjectRAR"R%RrRo(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/ext/instrumentation.pyts.   o La