ó
    úÞ jø  ã                  ó  • % S SK Jr  S SKJr  S SKrS SKrS SKJr  S SKJr  S SK	J
r
  S SK	Jr  SS	KJr  SS
KJr  SSKJr  \(       a  SSKJr  0 rS\S'   \R&                  " \5      r " S S5      rSS0rSS jrSS jrSS jr\" 5         g)é    )Úannotations)ÚmetadataN)ÚPattern)Ú
ModuleType)ÚCallable)ÚTYPE_CHECKINGé   )Úutil)ÚDispatchPriority)ÚPriorityDispatcher)ÚPriorityDispatchResultzdict[str, Plugin]Ú_all_pluginsc                  ó¤   • \ rS rSrSrSS jrSS jr SS\R                  S.           SS jjjr	\
      SS	 j5       r\
SS
 j5       rSrg)ÚPluginé   a  Describe a series of functions that are pulled in as a plugin.

This is initially to provide for portable lists of autogenerate
comparison functions, however the setup for a plugin can run any
other kinds of global registration as well.

.. versionadded:: 1.18.0

c                óž   • Xl         [        R                  SU5        U[        ;   a  [	        SU S35      eU [        U'   [        5       U l        g )Nzsetup plugin %szA plugin named z is already registered)ÚnameÚlogÚinfor   Ú
ValueErrorr   Úautogenerate_comparators)Úselfr   s     ÚQ/var/www/html/gaurav/venv/lib/python3.13/site-packages/alembic/runtime/plugins.pyÚ__init__ÚPlugin.__init__#   sH   € ØŒ	Ü�‰Ð" DÔ)Ø”<ÓÜ˜¨t¨fÐ4JÐKÓLÐLØ!Œ�TÑÜ(:Ó(<ˆÕ%ó    c                ó&   • [         U R                  	 g)zremove this pluginN)r   r   )r   s    r   ÚremoveÚPlugin.remove+   s   € ô ˜Ÿ™Ñ#r   NÚdefault)Ú	qualifierÚpriorityc               óH   • U R                   R                  UUUUS9" U5        g)aÍ  Register an autogenerate comparison function.

See the section :ref:`plugins_registering_autogenerate` for detailed
examples on how to use this method.

:param fn: The comparison function to register. The function receives
 arguments specific to the type of comparison being performed and
 should return a :class:`.PriorityDispatchResult` value.

:param compare_target: The type of comparison being performed
 (e.g., ``"table"``, ``"column"``, ``"type"``).

:param compare_element: Optional sub-element being compared within
 the target type.

:param qualifier: Database dialect qualifier. Use ``"default"`` for
 all dialects, or specify a dialect name like ``"postgresql"`` to
 register a dialect-specific handler. Defaults to ``"default"``.

:param priority: Execution priority for this comparison function.
 Functions are executed in priority order from
 :attr:`.DispatchPriority.FIRST` to :attr:`.DispatchPriority.LAST`.
 Defaults to :attr:`.DispatchPriority.MEDIUM`.

)Úsubgroupr"   r!   N)r   Údispatch_for)r   ÚfnÚcompare_targetÚcompare_elementr!   r"   s         r   Úadd_autogenerate_comparatorÚ"Plugin.add_autogenerate_comparator0   s4   € ðD 	×%Ñ%×2Ñ2ØØ$ØØð	 	3ñ 	
ð
 õ	r   c           
     ó
  ^
• [        5       n0 n[        5       nU HW  nUR                  S5      (       a(  UR                  [        [	        USS 5      5      5        MA  [        [	        U5      5      XF'   MY     [
        R                  5        H©  m
[        U
4S jU 5       5      (       a  M  U Vs/ sH)  otU   R                  T
R                  5      (       d  M'  UPM+     nnU(       d  M]  UR                  U5        [        R                  ST
R                  5        UR                  T
R                  5        M«     [        U5      R                  U5      n	U	(       a(  [         R"                  " SSR%                  U	5       35      egs  snf )zWPopulate all current autogenerate comparison functions into
a given PriorityDispatcher.Ú~é   Nc              3  óV   >#   • U H  oR                  TR                  5      v •  M!     g 7f©N)Úmatchr   )Ú.0ÚexclÚplugins     €r   Ú	<genexpr>ÚAPlugin.populate_autogenerate_priority_dispatch.<locals>.<genexpr>n   s   øé € Ð?±w¨t—:‘:˜fŸk™k×*Ð*²wùs   ƒ&)z!setting up autogenerate plugin %szDid not locate plugins: z, )ÚsetÚ
startswithÚaddÚ_make_reÚ_translate_legacy_namer   ÚvaluesÚanyr0   r   Úupdater   r   Úpopulate_withr   Ú
differencer
   ÚCommandErrorÚjoin)ÚclsÚcomparatorsÚinclude_pluginsÚexcludeÚincludeÚmatched_expressionsr   ÚinclÚinclude_matchesÚnever_matchedr3   s             @r   Ú'populate_autogenerate_priority_dispatchÚ.Plugin.populate_autogenerate_priority_dispatchY   sE  ø€ ô &)£UˆØ+-ˆä(+«Ðã#ˆDð �‰˜s×#Ñ#Ø—‘œHÔ%;¸DÀÀ¸HÓ%EÓFÖGä (Ô)?ÀÓ)EÓ F�“ñ $ô #×)Ñ)Ö+ˆFÜÔ?±wÓ?×?Ñ?Ùñ ")óÙ!(˜°D©M×,?Ñ,?ÀÇÁ×,L—¡ð ð ö #Ùà#×*Ñ*¨?Ô;ä�H‰HÐ8¸&¿+¹+ÔFØ×%Ñ% f×&EÑ&EÖFñ ,ô ˜G›×/Ñ/Ð0CÓDˆÞÜ×#Ò#Ø*¨4¯9©9°]Ó+CÐ*DÐEóð ð ùòs   Â,%F ÃF c                ó8   • UR                  [        U5      5        g)a¼  Call the ``setup()`` function of a plugin module, identified by
passing the module object itself.

E.g.::

    from alembic.runtime.plugins import Plugin
    import myproject.alembic_plugin

    # Register the plugin manually
    Plugin.setup_plugin_from_module(
        myproject.alembic_plugin,
        "myproject.custom_operations"
    )

This will generate a new :class:`.Plugin` object with the given
name, which will register itself in the global list of plugins.
Then the module's ``setup()`` function is invoked, passing that
:class:`.Plugin` object.

This exact process is invoked automatically at import time for any
plugin module that is published via the ``alembic.plugins`` entrypoint.

N)Úsetupr   )rB   Úmoduler   s      r   Úsetup_plugin_from_moduleÚPlugin.setup_plugin_from_module‚   s   € ð2 	�‰”V˜D“\Õ"r   )r   r   )r   Ústr©ÚreturnÚNoner/   )r&   z%Callable[..., PriorityDispatchResult]r'   rR   r(   z
str | Noner!   rR   r"   r   rT   rU   )rC   r   rD   z	list[str]rT   rU   )rO   r   r   rR   rT   rU   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   ÚMEDIUMr)   ÚclassmethodrK   rP   Ú__static_attributes__© r   r   r   r      sª   † ñô=ô$ð '+ð	'ð #Ø%5×%<Ñ%<ñ'à1ð'ð ð'ð $ð	'ð ð'ð #ð'ð 
ö'ðR ð&Ø,ð&Ø?Hð&à	ó&ó ð&ðP ó#ó ó#r   r   z+alembic.autogenerate.checkconstraint_bynamez"alembic.ext.checkconstraint_bynamec                ó,   • [         R                  X 5      $ )a,  Resolve a plugin name that has been renamed to its current name.

This allows an ``env.py`` written against an earlier Alembic release to
keep working, whether the name is used to include or to exclude the
plugin.  Wildcard expressions are never translated, as only fully
stated names are eligible.

)Ú_legacy_plugin_namesÚget)r   s    r   r:   r:   ¨   s   € ô  ×#Ñ# DÓ/Ð/r   c                óæ   • U R                  S5      nSnU H<  nUS:X  a  US-  nM  UR                  5       (       a
  USU-   -  nM/  [        SU < 35      e   [        R                  " SUSS   S	35      $ )
NÚ.Ú Ú*z\..+?z\.zInvalid plugin expression Ú^r	   Ú$)ÚsplitÚisidentifierr   ÚreÚcompile)r   ÚtokensÚregÚtokens       r   r9   r9   ´   s}   € Ø�Z‰Z˜‹_€Fà
€CÛˆØ�C‹<Ø�8‰OŠCØ×Ñ×!Ñ!Ø�5˜5‘=Ñ ŠCäÐ9¸$¹ÐBÓCÐCñ ô �:Š:˜˜#˜a˜b˜'˜ !�nÓ%Ð%r   c                 ó¦   • [         R                  " SS9 H9  n U R                  5        H"  n[        R	                  XR
                  5        M$     M;     g )Nzalembic.plugins)Úgroup)r   Úentry_pointsÚloadr   rP   r   )Ú
entrypointÚmods     r   Ú_setupru   Ä   s<   € ä×+Ò+Ð2CÔDˆ
Ø—?‘?Ö$ˆCÜ×+Ñ+¨C·±ÖAó %ò Er   )r   rR   rT   rR   )r   rR   rT   zPattern[str]rS   )Ú
__future__r   Ú	importlibr   Úloggingrj   r   Útypesr   Útypingr   r   rd   r
   r   r   r   r   Ú__annotations__Ú	getLoggerrV   r   r   r`   r:   r9   ru   r^   r   r   Ú<module>r}      s}   ðÞ "å Û Û 	Ý Ý Ý Ý  å Ý #Ý %æÝ-à"$€ÐÓ $ð ×Ò˜Ó!€÷C#ñ C#ðT 2Ø,ðÐ ô	0ô&ô Bñ …r   