U kf@sdZddlmZddlZddlmZddlmZddlmZddlmZeded efd Z erbdd l m Z dd l m Zdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZ ddlm!Z"ddlm#Z$ddlm%Z&ddlm'Z(ddlm)Z*ddlm+Z,ddlm-Z.ddlm/Z0ddlm1Z2ddlm3Z4ddlm5Z6dd lm7Z8dd!l9m:Z;dd"l9mZ?dd$l9m@ZAdd%l9mBZCdd&l9mDZEdd'l9mFZGdd(l9mHZIdd)l9mJZKdd l9m7ZLe Z eZMeZNeZOeZPeZQe ZReZSeZ eZTe"ZUe$ZVe(ZWe&ZXe*ZYe,ZZe.Z[e0Z\e4Z]e6Z^e2Z_e8Z`e;Zae=Zbe?ZceAZdeCZeeGZfeKZgeEZheIZieLZjGd*d+d+ZkekZleljmZmeljnZndS),zRsupplies the "preloaded" registry to resolve circular module imports at runtime. ) annotationsN)Any)Callable) TYPE_CHECKING)TypeVar_FN.)bound)dialects)orm)cursor)default) reflection)result)url) attributes)base) clsregistry)decl_api) decl_base) dependency)descriptor_props) mapperlib) properties) relationships)session)state) strategies)strategy_options)util)default_comparator)dml)elements) functions)naming)schema) selectable)sqltypes) traversalsc@s:eZdZdZdddZddddd Zdd d d d ZdS)_ModuleRegistryaRegistry of modules to load in a package init file. To avoid potential thread safety issues for imports that are deferred in a function, like https://bugs.python.org/issue38884, these modules are added to the system module cache by importing them after the packages has finished initialization. A global instance is provided under the name :attr:`.preloaded`. Use the function :func:`.preload_module` to register modules to load and :meth:`.import_prefix` to load all the modules that start with the given path. While the modules are loaded in the global module cache, it's advisable to access them using :attr:`.preloaded` to ensure that it was actually registered. Each registered module is added to the instance ``__dict__`` in the form `_`, omitting ``sqlalchemy`` from the package name. Example: ``sqlalchemy.sql.util`` becomes ``preloaded.sql_util``. sqlalchemy.cCst|_||_dSN)setmodule_registryprefix)selfr-r/I/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/util/preloaded.py__init__rsz_ModuleRegistry.__init__strzCallable[[_FN], _FN])depsreturncGs|j|ddS)zAdds the specified modules to the list to load. This method can be used both as a normal function and as a decorator. No change is performed to the decorated object. cSs|Sr*r/)fnr/r/r0}z0_ModuleRegistry.preload_module..)r,update)r.r3r/r/r0preload_modulevs z_ModuleRegistry.preload_moduleNone)pathr4cCsv|jD]j}|jr*||jddd}n|}|r<||r||jkrt|ttt j ||j|<t|<qdS)z\Resolve all the modules in the registry that start with the specified path. ._N) r,r-splitreplace startswith__dict__ __import__globalslocalssysmodules)r.r;modulekeyr/r/r0 import_prefixs z_ModuleRegistry.import_prefixN)r))__name__ __module__ __qualname____doc__r1r9rJr/r/r/r0r(^s  r()orN __future__rrFtypingrrrrrZ sqlalchemyr _dialectsr Z_ormZsqlalchemy.enginer Z_engine_cursorr Z_engine_defaultr Z_engine_reflectionrZ_engine_resultrZ _engine_urlZsqlalchemy.ormrZ_orm_attributesrZ _orm_baserZ_orm_clsregistryrZ _orm_decl_apirZ_orm_decl_baserZ_orm_dependencyrZ_orm_descriptor_propsrZ _orm_mapperrZ_orm_propertiesrZ_orm_relationshipsrZ _orm_sessionrZ _orm_staterZ_orm_strategiesrZ_orm_strategy_optionsrZ _orm_utilZsqlalchemy.sqlrZ_sql_default_comparatorr Z_sql_dmlr!Z _sql_elementsr"Z_sql_functionsr#Z _sql_namingr$Z _sql_schemar%Z_sql_selectabler&Z _sql_sqltypesr'Z_sql_traversalsZ _sql_utilZ engine_cursorZengine_defaultZengine_reflectionZ engine_resultZ engine_urlZorm_clsregistryZorm_baseZorm_attributesZ orm_decl_apiZ orm_decl_baseZorm_descriptor_propsZorm_dependencyZ orm_mapperZorm_propertiesZorm_relationshipsZ orm_sessionZorm_strategiesZorm_strategy_optionsZ orm_stateZorm_utilZsql_default_comparatorZsql_dmlZ sql_elementsZ sql_functionsZ sql_namingZsql_selectableZsql_traversalsZ sql_schemaZ sql_sqltypesZsql_utilr(Z_regr9rJr/r/r/r0 s                                     1