관리-도구
편집 파일: instrumentation.cpython-311.pyc
� �܋f#8 � �@ � d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lmZ dd l mZ ddl mZ ddl mZ dd l mZ ddl mZ dZ d� ZegZ G d� de� � Z e� � xe_ Zee_ G d� de� � Z G d� 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 | t d� � S )z;Find user-specified instrumentation management for a class.N)�getattr�INSTRUMENTATION_MANAGER��clss �q/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/sqlalchemy/ext/instrumentation.py�%find_native_user_instrumentation_hookr ; s � ��3�/��6�6�6� c � � � e Zd ZdZ ej � � Z ej � � Z ej � � ZdZ d� Z d� Zd� Zd� Z � fd�Zd� Zd � Zd � Z� xZS )�ExtendedInstrumentationRegistryz�Extends :class:`.InstrumentationFactory` with additional bookkeeping, to accommodate multiple types of class managers. Fc �l � t D ]+} ||� � }|�| � ||� � }||fc S �,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����'�'�'�'� #� �:r c � � | � |� � � |g� � }|r't d|j �dt |� � ��� � �d S )Nz6multiple instrumentation implementations specified in z inheritance hierarchy: )�!_collect_management_factories_for� difference� TypeError�__name__�list)r r r �existing_factoriess r �_check_conflictsz0ExtendedInstrumentationRegistry._check_conflictsf sr � �!�C�C�� � � �*�g�Y� � � � � ��)� �?�?�?�D�);�$<�$<�$<�>�� � � � r c �\ � ||� � }t |t � � st ||� � }|t k r| j sd| _ t � � |� � � | j |<