§ w<ˆj#8ãó@—dZddlZddlmZddlmZddlmZddlmZddlm Z dd lm Z dd l mZdd l mZdd l mZdd l mZddl mZdZ d„ZegZ Gd„de¦«Ze¦«xe _Zee _Gd„de¦«ZGd„de¦«Zd„Zd„Zd„ZdS)a�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`. éNé)Úutil)Ú attributes)Úbase)Ú collections)Úexc)Úinstrumentation)Ú_default_dict_getter)Ú_default_manager_getter)Ú_default_state_getter)Ú ClassManager)ÚInstrumentationFactoryÚ__sa_instrumentation_manager__có.—t|td¦«S)z;Find user-specified instrumentation management for a class.N)ÚgetattrÚINSTRUMENTATION_MANAGER©Úclss úr/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/sqlalchemy/ext/instrumentation.pyÚ%find_native_user_instrumentation_hookr;s€å �3Õ/°Ñ 6Ô 6Ð6óc󪇗eZdZdZej¦«Zej¦«Zej¦«ZdZ d„Z d„Z d„Z d„Z ˆfd„Zd„Zd „Zd „ZˆxZS) ÚExtendedInstrumentationRegistryz„Extends :class:`.InstrumentationFactory` with additional bookkeeping, to accommodate multiple types of class managers. Fcól—tD]+}||¦«}|�| ||¦«}||fcSŒ,dS)N)NN)Úinstrumentation_findersÚ_extended_class_manager)ÚselfÚclass_ÚfinderÚfactoryÚmanagers rÚ_locate_extended_factoryz8ExtendedInstrumentationRegistry._locate_extended_factory]sV€Ý-ð ð ˆFØ�f˜V‘n”nˆGØÐ"Ø×6Ò6°v¸wÑGÔG�Ø Ð'Ð'Ð'Ð'ð#ð�:rcóª—| |¦« |g¦«}|r'td|j›dt |¦«›�¦«‚dS)Nz6multiple instrumentation implementations specified in z inheritance hierarchy: )Ú!_collect_management_factories_forÚ differenceÚ TypeErrorÚ__name__Úlist)rrr Úexisting_factoriess rÚ_check_conflictsz0ExtendedInstrumentationRegistry._check_conflictsfsr€Ø!×CÒCØ ñ ô ç Š*�g�YÑ Ô ð ð ð Ý�)ð”?�?�?¥DÐ);Ñ$<Ô$<Ð$<ð>ñôð ð ð rcó\—||¦«}t|t¦«st||¦«}|tkr|jsd|_t ¦«| ¦«|j|<| ¦«|j|<|  ¦«|j |<|S)NT) Ú isinstancer Ú_ClassInstrumentationAdapterÚ _extendedÚ_install_instrumented_lookupsÚmanager_getterÚ_manager_findersÚ state_getterÚ_state_findersÚ dict_getterÚ _dict_finders)rrr r!s rrz7ExtendedInstrumentationRegistry._extended_class_managerqs¨€Ø�'˜&‘/”/ˆÝ˜'¥<Ñ0Ô0ð DÝ2°6¸7ÑCÔCˆGà •lÒ "Ð "¨4¬>Ð "ð"ˆDŒNÝ )Ñ +Ô +Ð +à(/×(>Ò(>Ñ(@Ô(@ˆÔ˜fÑ%Ø&-×&:Ò&:Ñ&<Ô&<ˆÔ˜FÑ#Ø%,×%8Ò%8Ñ%:Ô%:ˆÔ˜6Ñ"؈rcóB—tj|¦«}t¦«}|D]d}| |¦«}|�| |j¦«Œ4t D]}||¦«}|�nŒd}| |¦«Œe| d¦«|S)acReturn 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)rÚclass_hierarchyÚsetÚmanager_of_classÚaddr rÚdiscard)rrÚ hierarchyÚ factoriesÚmemberr!rr s rr$zAExtendedInstrumentationRegistry._collect_management_factories_for‚s¾€õÔ(¨Ñ-Ô-ˆ Ý‘E”Eˆ Øð 'ð 'ˆFØ×+Ò+¨FÑ3Ô3ˆGØÐ"Ø— ’ ˜gœoÑ.Ô.Ð.Ð.å5ð#ð#�FØ$˜f V™nœn�GØÐ*ؘð+ð#�GØ— ’ ˜gÑ&Ô&Ð&Ð&Ø×Ò˜$ÑÔÐØÐrcóš•—||jvr|j|=|j|=|j|=tt|¦« |¦«dS©N)r1r3r5ÚsuperrÚ unregister)rrÚ __class__s €rrBz*ExtendedInstrumentationRegistry.unregister�sWø€Ø �TÔ*Ð *Ð *ØÔ% fÐ-ØÔ# FÐ+ØÔ" 6Ð*Ý Õ-¨tÑ4Ô4×?Ò?ÀÑGÔGÐGÐGÐGrcó„—|€dS |j |t¦«}||¦«S#t$rYdSwxYwr@)r1Úgetr r&)rrrs rr9z0ExtendedInstrumentationRegistry.manager_of_class¤s^€Ø ˆ;Ø�4ð ØÔ*×.Ò.¨sÕ4KÑLÔLˆFð �6˜#‘;”;Ð øõ ð ð ð à�4�4ð øøøs † 1± ?¾?có€—|€td¦«‚|j |jt¦«|¦«S©NzNone has no persistent state.)ÚAttributeErrorr3rErCr ©rÚinstances rÚstate_ofz(ExtendedInstrumentationRegistry.state_of¯sL€Ø Ð Ý Ð!@ÑAÔAÐ Að ˆtÔ"×&Ò&Ø Ô Õ 5ñ ô à ñôð rcó€—|€td¦«‚|j |jt¦«|¦«SrG)rHr5rErCr rIs rÚdict_ofz'ExtendedInstrumentationRegistry.dict_of¶sL€Ø Ð Ý Ð!@ÑAÔAÐ Að ˆtÔ!×%Ò%Ø Ô Õ 4ñ ô à ñôð r)r'Ú __module__Ú __qualname__Ú__doc__ÚweakrefÚWeakKeyDictionaryr1r3r5r.r"r*rr$rBr9rKrMÚ __classcell__©rCs@rrrQsèø€€€€€ððð 1�wÔ0Ñ2Ô2ÐØ.�WÔ.Ñ0Ô0€NØ-�GÔ-Ñ/Ô/€MØ€Iðððð ð ð ðððð"ððð6HðHðHðHðHð ð ð ððððððððððrrcóx—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„ZdS)ÚInstrumentationManageraWUser-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. có—dSr@©©rrs rÚ__init__zInstrumentationManager.__init__Ùó€Ø ˆrcó(—t|d|¦«dS©NÚ_default_class_manager©Úsetattr©rrr!s rÚmanagezInstrumentationManager.manageÜs€Ý�Ð0°'Ñ:Ô:Ð:Ð:Ð:rcó&—t|d¦«dSr]©Údelattrras rÚdisposezInstrumentationManager.disposeßs€Ý�Ð0Ñ1Ô1Ð1Ð1Ð1rcó —d„}|S)Ncó—|jSr@)r^rs rrEz2InstrumentationManager.manager_getter..getãs €ØÔ-Ð -rrX)rrrEs rr0z%InstrumentationManager.manager_getterâs€ð .ð .ð .ðˆ rcó—dSr@rX©rrÚkeyÚinsts rÚinstrument_attributez+InstrumentationManager.instrument_attributeèr[rcó—dSr@rXrjs rÚpost_configure_attributez/InstrumentationManager.post_configure_attributeër[rcó(—t|||¦«dSr@r_rjs rÚinstall_descriptorz)InstrumentationManager.install_descriptorîs€Ý�˜˜TÑ"Ô"Ð"Ð"Ð"rcó&—t||¦«dSr@rd©rrrks rÚuninstall_descriptorz+InstrumentationManager.uninstall_descriptorñó€Ý�˜ÑÔÐÐÐrcó(—t|||¦«dSr@r_)rrrkÚimplementations rÚinstall_memberz%InstrumentationManager.install_memberôs€Ý�˜˜^Ñ,Ô,Ð,Ð,Ð,rcó&—t||¦«dSr@rdrss rÚuninstall_memberz'InstrumentationManager.uninstall_member÷rurcó*—tj|¦«Sr@)rÚprepare_instrumentation)rrrkÚcollection_classs rÚinstrument_collection_classz2InstrumentationManager.instrument_collection_classús€ÝÔ2Ð3CÑDÔDÐDrcó—|jSr@)Ú__dict__©rrrJs rÚget_instance_dictz(InstrumentationManager.get_instance_dictýs €ØÔ Ð rcó—dSr@rXr�s rÚinitialize_instance_dictz/InstrumentationManager.initialize_instance_dictr[rcó(—t|d|¦«dS©NÚ_default_stater_)rrrJÚstates rÚ install_statez$InstrumentationManager.install_states€Ý�Ð*¨EÑ2Ô2Ð2Ð2Ð2rcó&—t|d¦«dSr†rdr�s rÚ remove_statez#InstrumentationManager.remove_states€Ý�Ð*Ñ+Ô+Ð+Ð+Ð+rcó—d„S)Ncó"—t|d¦«Sr†)r)rJs rúz5InstrumentationManager.state_getter.. s€¥¨Ð2BÑ CÔ C€rrXrYs rr2z#InstrumentationManager.state_getter s €ØCÐCÐCrc󇇗ˆˆfd„S)Ncó0•—‰ ‰|¦«Sr@)r‚)rlrrs €€rrŽz4InstrumentationManager.dict_getter.. sø€˜D×2Ò2°6¸4Ñ@Ô@€rrXrYs``rr4z"InstrumentationManager.dict_getter søø€Ø@Ð@Ð@Ð@Ð@Ð@rN)r'rNrOrPrZrbrfr0rmrorqrtrxrzr~r‚r„r‰r‹r2r4rXrrrVrVÄs(€€€€€ððð( ð ð ð;ð;ð;ð2ð2ð2ðððð  ð ð ð ð ð ð#ð#ð#ðððð-ð-ð-ððððEðEðEð!ð!ð!ð ð ð ð3ð3ð3ð,ð,ð,ðDðDðDðAðAðAðAðArrVc󔇗eZdZdZd„Zd„Zd„Zd„Zdd„Zˆfd„Z d „Z d „Z d „Z d „Z d „Zd„Zdd„Zd„Zdd„Zd„Zd„Zd„Zd„ZˆxZS)r-z?Adapts a user-defined InstrumentationManager to a ClassManager.cóº—||_|j |¦«|_|j |¦«|_t j||¦«dSr@)Ú_adaptedr2Ú _get_stater4Ú _get_dictr rZ)rrÚoverrides rrZz%_ClassInstrumentationAdapter.__init__sP€Ø ˆŒ Øœ-×4Ò4°VÑ<Ô<ˆŒØœ×2Ò2°6Ñ:Ô:ˆŒåÔ˜d FÑ+Ô+Ð+Ð+Ð+rcóF—|j |j|¦«dSr@)r“rbr©rs rrbz#_ClassInstrumentationAdapter.manages"€Ø Œ ×Ò˜Tœ[¨$Ñ/Ô/Ð/Ð/Ð/rcóD—|j |j¦«dSr@)r“rfrr˜s rrfz$_ClassInstrumentationAdapter.disposes €Ø Œ ×Ò˜dœkÑ*Ô*Ð*Ð*Ð*rcó@—|j |j¦«Sr@)r“r0rr˜s rr0z+_ClassInstrumentationAdapter.manager_getter s€ØŒ}×+Ò+¨D¬KÑ8Ô8Ð8rFcó~—tj||||¦«|s#|j |j||¦«dSdSr@)r rmr“r)rrkrlÚ propagateds rrmz1_ClassInstrumentationAdapter.instrument_attribute#sP€ÝÔ)¨$°°T¸:ÑFÔFÐFØð GØ ŒM× .Ò .¨t¬{¸CÀÑ FÔ FÐ FÐ FÐ Fð Gð Grc󦕗tt|¦« |¦«|j |j|||¦«dSr@)rAr-ror“r)rrkrCs €rroz5_ClassInstrumentationAdapter.post_configure_attribute(sHø€Ý Õ*¨DÑ1Ô1×JÒJÈ3ÑOÔOÐOØ Œ ×.Ò.¨t¬{¸CÀÀcÄÑKÔKÐKÐKÐKrcóH—|j |j||¦«dSr@)r“rqr)rrkrls rrqz/_ClassInstrumentationAdapter.install_descriptor,s$€Ø Œ ×(Ò(¨¬°c¸4Ñ@Ô@Ð@Ð@Ð@rcóF—|j |j|¦«dSr@)r“rtr©rrks rrtz1_ClassInstrumentationAdapter.uninstall_descriptor/s"€Ø Œ ×*Ò*¨4¬;¸Ñ<Ô<Ð<Ð<Њ>˜(Ñ #Ô #ð 1Ø�5à×&Ò& xÑ0Ô0Ð 0rcó¸—|j |j|¦«|€| ||¦«}|j |j||¦«|Sr@)r“r„rÚ_state_constructorr‰)rrJrˆs rr©z+_ClassInstrumentationAdapter.setup_instanceUsY€Ø Œ ×.Ò.¨t¬{¸HÑEÔEÐEà ˆ=Ø×+Ò+¨H°dÑ;Ô;ˆEð Œ ×#Ò# D¤K°¸5ÑAÔAÐA؈ rcóF—|j |j|¦«dSr@)r“r‹rrIs rÚteardown_instancez._ClassInstrumentationAdapter.teardown_instance_s"€Ø Œ ×"Ò" 4¤;°Ñ9Ô9Ð9Ð9Ð9rcó^— | |¦«dS#tj$rYdSwxYw)NTF)r”Úorm_excÚNO_STATErIs rr¬z&_ClassInstrumentationAdapter.has_statebsG€ð Ø �OŠO˜HÑ %Ô %Ð %ð�4øõÔð ð ð Ø�5�5ð øøøs ‚™,«,có—|jSr@)r”r˜s rr2z)_ClassInstrumentationAdapter.state_getterjs €ØŒÐrcó—|jSr@)r•r˜s rr4z(_ClassInstrumentationAdapter.dict_getterms €ØŒ~Ðr)Fr@)r'rNrOrPrZrbrfr0rmrorqrtrxrzr~r¥rªr­r©r±r¬r2r4rSrTs@rr-r-sjø€€€€€ØIÐIð,ð,ð,ð0ð0ð0ð+ð+ð+ð9ð9ð9ðGðGðGðGð LðLðLðLðLðAðAðAð=ð=ð=ðGðGðGð9ð9ð9ð ð ð ð ððððððð 1ð1ð1ððððð:ð:ð:ðððððððððððððrr-có€—tttjtjtj¬¦«¦«dS)aº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. ©Úinstance_stateÚ instance_dictr9N)Ú_install_lookupsÚdictÚ_instrumentation_factoryrKrMr9rXrrr/r/qsD€õÝ Ý3Ô<Ý2Ô:Ý5ÔFð ñ ô ñôðððrcóz—ttttt¬¦«¦«dt _dS)zRestore simplified lookups.r¸FN)r»r¼r r r r½r.rXrrÚ_reinstall_default_lookupsr¿‡s@€åÝ Ý0Ý.Ý4ð ñ ô ñôðð*/ÕÔ&Ð&Ð&rcó,—|da|da|datxt_xt_t _txt_xt_t _txt_xt_t _dS)Nr¹rºr9)r¹rºr9Úorm_baserÚorm_instrumentation)Úlookupss rr»r»“sŒ€àÐ-Ô.€NؘOÔ,€MØÐ1Ô2Ðõ.<ð<…HÔð<ÝÔ!ÝÔ*õ-:ð:…HÔð:ÝÔ ÝÔ)õ0@ð@…HÔð@ÝÔ#ÝÔ,Ð,Ð,r)rPrQÚrÚormrrrÁrrr³r rÂÚorm.instrumentationr r r r rrrrrr½ÚobjectrVr-r/r¿r»rXrrúrÈsðððð"€€€àÐÐÐÐÐØÐÐÐÐÐØ"Ð"Ð"Ð"Ð"Ð"ØÐÐÐÐÐØ Ð Ð Ð Ð Ð Ø8Ð8Ð8Ð8Ð8Ð8Ø6Ð6Ð6Ð6Ð6Ð6Ø9Ð9Ð9Ð9Ð9Ð9Ø7Ð7Ð7Ð7Ð7Ð7Ø.Ð.Ð.Ð.Ð.Ð.Ø8Ð8Ð8Ð8Ð8Ð8ð;Ððð27ð7ð7ð AÐAÐð ð jðjðjðjðjÐ&<ñjôjðjð^$Ð#Ñ%Ô%ð&ÐÔ,Øà.EÐÔ+ðIAðIAðIAðIAðIA˜VñIAôIAðIAðX^ð^ð^ð^ð^ <ñ^ô^ð^ðBððð, /ð /ð /ð @ð @ð @ð @ð @r