Ë
    ïÏjä‡  ã                  óÄ  — d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
Z
d dlZd dlZd dlmZ d dlZd dlZd d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  ej@                  e!«      Z" G d„ d«      Z#ee$e$f   Z% G d„ ded¬«      Z& G d„ de«      Z' G d„ d«      Z(	 	 d!	 	 	 	 	 	 	 d"d„Z)e!d k(  r e)«        yy)#é    )Úannotations)ÚArgumentParser)Ú	Namespace)ÚMapping)ÚSequence)ÚConfigParserN)ÚPath)ÚAny)Úcast)Úoverload)ÚProtocol)ÚTextIO)Ú	TypedDicté   )Ú__version__)Úcommand)Úutil)Úcompat)Ú_preserving_path_as_strc                  ó  — e Zd ZU dZddddej
                  d ej                  «       df	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d)d„ZdZ	de
d<   	 dZde
d	<   	 dZde
d
<   	 ed*d„«       Zed*d„«       ZdZde
d<   	 ej"                  d+d„«       Zd,d„Zej"                  d-d„«       Zej"                  d.d„«       Zd/d„Zd0d„Ze	 d1	 	 	 	 	 d2d„«       Ze	 	 	 	 	 	 d3d„«       Ze	 	 	 	 	 	 d4d„«       Z	 d5	 	 	 	 	 d6d„Zd7d„Zd8d„Zd9d„Z	 d5	 	 	 	 	 	 	 d:d„Zed;d„«       Ze	 d5	 	 	 	 	 d<d„«       Z	 d5	 	 	 	 	 d<d„Zed;d„«       Ze	 d5	 	 	 	 	 d<d „«       Z	 d5	 	 	 	 	 d=d!„Zd>d"„Z 	 d5	 	 	 	 	 d?d#„Z!ej"                  d@d$„«       Z"dAd%„Z#dBd&„Z$dBd'„Z%dCd(„Z&y)DÚConfiga;  Represent an Alembic configuration.

    Within an ``env.py`` script, this is available
    via the :attr:`.EnvironmentContext.config` attribute,
    which in turn is available at ``alembic.context``::

        from alembic import context

        some_param = context.config.get_main_option("my option")

    When invoking Alembic programmatically, a new
    :class:`.Config` can be created by passing
    the name of an .ini file to the constructor::

        from alembic.config import Config
        alembic_cfg = Config("/path/to/yourapp/alembic.ini")

    With a :class:`.Config` object, you can then
    run Alembic commands programmatically using the directives
    in :mod:`alembic.command`.

    The :class:`.Config` object can also be constructed without
    a filename.   Values can be set programmatically, and
    new sections will be created as needed::

        from alembic.config import Config
        alembic_cfg = Config()
        alembic_cfg.set_main_option("script_location", "myapp:migrations")
        alembic_cfg.set_main_option("sqlalchemy.url", "postgresql://foo/bar")
        alembic_cfg.set_section_option("mysection", "foo", "bar")

    .. warning::

       When using programmatic configuration, make sure the
       ``env.py`` file in use is compatible with the target configuration;
       including that the call to Python ``logging.fileConfig()`` is
       omitted if the programmatic configuration doesn't actually include
       logging directives.

    For passing non-string values to environments, such as connections and
    engines, use the :attr:`.Config.attributes` dictionary::

        with engine.begin() as connection:
            alembic_cfg.attributes['connection'] = connection
            command.upgrade(alembic_cfg, "head")

    :param file\_: name of the .ini file to open if an ``alembic.ini`` is
     to be used.    This should refer to the ``alembic.ini`` file, either as
     a filename or a full path to the file.  This filename if passed must refer
     to an **ini file in ConfigParser format** only.

    :param toml\_file: name of the pyproject.toml file to open if a
     ``pyproject.toml`` file is to be used.  This should refer to the
     ``pyproject.toml`` file, either as a filename or a full path to the file.
     This file must be in toml format. Both :paramref:`.Config.file\_` and
     :paramref:`.Config.toml\_file` may be passed simultaneously, or
     exclusively.

     .. versionadded:: 1.16.0

    :param ini_section: name of the main Alembic section within the
     .ini file
    :param output_buffer: optional file-like input buffer which
     will be passed to the :class:`.MigrationContext` - used to redirect
     the output of "offline generation" when using Alembic programmatically.
    :param stdout: buffer where the "print" output of commands will be sent.
     Defaults to ``sys.stdout``.

    :param config_args: A dictionary of keys and values that will be used
     for substitution in the alembic config file, as well as the pyproject.toml
     file, depending on which / both are used.  The dictionary as given is
     **copied** to two new, independent dictionaries, stored locally under the
     attributes ``.config_args`` and ``.toml_args``.   Both of these
     dictionaries will also be populated with the replacement variable
     ``%(here)s``, which refers to the location of the .ini and/or .toml file
     as appropriate.

    :param attributes: optional dictionary of arbitrary Python keys/values,
     which will be populated into the :attr:`.Config.attributes` dictionary.

     .. seealso::

        :ref:`connection_sharing`

    NÚalembicÚstrÚcmd_optsúNamespace | Nonec	                ó  — |rt        |«      nd| _        |rt        |«      nd| _        || _        || _        || _        || _        t        |«      | _        t        |«      | _	        |r| j                  j                  |«       yy)z Construct a new :class:`.Config`N)r   Úconfig_file_nameÚtoml_file_nameÚconfig_ini_sectionÚoutput_bufferÚstdoutr   ÚdictÚconfig_argsÚ	toml_argsÚ
attributesÚupdate)	ÚselfÚfile_Ú	toml_fileÚini_sectionr    r!   r   r#   r%   s	            úK/var/www/html/gaurav-v2/venv/lib/python3.12/site-packages/alembic/config.pyÚ__init__zConfig.__init__v   sƒ   € ñ /4Ô# EÔ*¸ð 	Ôñ 3<Ô# IÔ.Àð 	Ôð #.ˆÔØ*ˆÔØˆŒØ ˆŒÜ Ó,ˆÔÜ˜kÓ*ˆŒÙØ�O‰O×"Ñ" :Õ.ð ó    ú
str | Noner   r   c                óF   — | j                   €y t        | j                   «      S ©N)r   r	   ©r'   s    r+   Ú_config_file_pathzConfig._config_file_path§   s"   € à× Ñ Ð(ØÜ�D×)Ñ)Ó*Ð*r-   c                óF   — | j                   €y t        | j                   «      S r0   )r   r	   r1   s    r+   Ú_toml_file_pathzConfig._toml_file_path­   s"   € à×ÑÐ&ØÜ�D×'Ñ'Ó(Ð(r-   r   c                ó   — i S )aþ  A Python dictionary for storage of additional state.


        This is a utility dictionary which can include not just strings but
        engines, connections, schema objects, or anything else.
        Use this to pass objects into an env.py script, such as passing
        a :class:`sqlalchemy.engine.base.Connection` when calling
        commands from :mod:`alembic.command` programmatically.

        .. seealso::

            :ref:`connection_sharing`

            :paramref:`.Config.attributes`

        © r1   s    r+   r%   zConfig.attributes»   s	   € ð$ ˆ	r-   c                ó”   — |rt        |«      |z  }nt        |«      }t        j                  | j                  |dfi | j                  ¤Ž y)a¤  Render a message to standard out.

        When :meth:`.Config.print_stdout` is called with additional args
        those arguments will formatted against the provided text,
        otherwise we simply output the provided text verbatim.

        This is a no-op when the``quiet`` messaging option is enabled.

        e.g.::

            >>> config.print_stdout('Some text %s', 'arg')
            Some Text arg

        Ú
N)r   r   Úwrite_outstreamr!   Úmessaging_opts)r'   ÚtextÚargÚoutputs       r+   Úprint_stdoutzConfig.print_stdoutÏ   s>   € ñ  Ü˜“Y ‘_‰Fä˜“YˆFä×Ñ˜TŸ[™[¨&°$ÑN¸$×:MÑ:MÓNr-   c                ó  — | j                   r%| j                   j                  «       j                  }n
t        «       }|j	                  «       | j
                  d<   t        | j
                  «      }t        | j                  dd«      }| j                   rEt        j                  || j                   g«       |r t        j                  d| j                   «       |S |j                  | j                  «       |rt        j                  d«       |S )a  Return the underlying ``ConfigParser`` object.

        Dir*-ect access to the .ini file is available here,
        though the :meth:`.Config.get_section` and
        :meth:`.Config.get_main_option`
        methods provide a possibly simpler interface.

        ÚhereÚverboseFzLoading config from file: %sz7No config file provided; using in-memory default config)r2   ÚabsoluteÚparentr	   Úas_posixr#   r   Úgetattrr   r   Úread_config_parserÚlogÚinfoÚadd_sectionr   )r'   r@   Úfile_configrA   s       r+   rJ   zConfig.file_configæ   sÚ   € ð ×!Ò!Ø×)Ñ)×2Ñ2Ó4×;Ñ;‰Dä“6ˆDØ#'§=¡=£?ˆ×Ñ˜Ñ Ü" 4×#3Ñ#3Ó4ˆä˜$Ÿ-™-¨°EÓ:ˆØ×!Ò!Ü×%Ñ% k°D×4JÑ4JÐ3KÔLÙÜ—‘Ø2°D×4JÑ4Jôð Ðð ×#Ñ# D×$;Ñ$;Ô<ÙÜ—‘ØMôð Ðr-   c                óü  — | j                   rã| j                   j                  «       rÉ| j                   j                  «       j                  }|j	                  «       | j
                  d<   t        | j                   d«      5 }t        j                  j                  |«      }|j                  di «      j                  di «      }t        |t        «      st        j                  d«      ‚|cddd«       S i S # 1 sw Y   yxY w)zMReturn a dictionary of the [tool.alembic] section from
        pyproject.tomlr@   ÚrbÚtoolr   zIncorrect TOML formatN)r4   ÚexistsrB   rC   rD   r$   Úopenr   ÚtomllibÚloadÚgetÚ
isinstancer"   r   ÚCommandError)r'   r@   ÚfÚ	toml_dataÚdatas        r+   Útoml_alembic_configzConfig.toml_alembic_config  sÆ   € ð
 ×Ò D×$8Ñ$8×$?Ñ$?Ô$Aà×'Ñ'×0Ñ0Ó2×9Ñ9ˆDØ%)§]¡]£_ˆD�N‰N˜6Ñ"ä�d×*Ñ*¨DÔ1°QÜ"ŸN™N×/Ñ/°Ó2�	Ø —}‘} V¨RÓ0×4Ñ4°YÀÓC�Ü! $¬Ô-Ü×+Ñ+Ð,CÓDÐDØ÷ 2Ñ1ð ˆI÷ 2Ð1ús   Á>A(C2Ã2C;c                ó€   — ddl }t        |j                  «      j                  «       j                  }t        |dz  «      S )z¥Return the directory where Alembic setup templates are found.

        This method is used by the alembic ``init`` and ``list_templates``
        commands.

        r   NÚ	templates)r   r	   Ú__file__rB   rC   r   )r'   r   Úpackage_dirs      r+   Úget_template_directoryzConfig.get_template_directory  s6   € ó 	ä˜7×+Ñ+Ó,×5Ñ5Ó7×>Ñ>ˆÜ�; Ñ,Ó-Ð-r-   c                ó4   — t        | j                  «       «      S )zÇReturn the directory where Alembic setup templates are found.

        This method is used by the alembic ``init`` and ``list_templates``
        commands.

        .. versionadded:: 1.16.0

        )r	   r]   r1   s    r+   Ú_get_template_pathzConfig._get_template_path'  s   € ô �D×/Ñ/Ó1Ó2Ð2r-   c                 ó   — y r0   r6   ©r'   ÚnameÚdefaults      r+   Úget_sectionzConfig.get_section2  s   € ð !$r-   c                 ó   — y r0   r6   ra   s      r+   rd   zConfig.get_section:  s   € ð r-   c                 ó   — y r0   r6   ra   s      r+   rd   zConfig.get_section?  s   € ð .1r-   c                ó„   — | j                   j                  |«      s|S t        | j                   j                  |«      «      S )zùReturn all the configuration options from a given .ini file section
        as a dictionary.

        If the given section does not exist, the value of ``default``
        is returned, which is expected to be a dictionary or other mapping.

        )rJ   Úhas_sectionr"   Úitemsra   s      r+   rd   zConfig.get_sectionD  s9   € ð ×Ñ×+Ñ+¨DÔ1ØˆNä�D×$Ñ$×*Ñ*¨4Ó0Ó1Ð1r-   c                ó>   — | j                  | j                  ||«       y)a:  Set an option programmatically within the 'main' section.

        This overrides whatever was in the .ini file.

        :param name: name of the value

        :param value: the value.  Note that this value is passed to
         ``ConfigParser.set``, which supports variable interpolation using
         pyformat (e.g. ``%(some_value)s``).   A raw percent sign not part of
         an interpolation symbol must therefore be escaped, e.g. ``%%``.
         The given value may refer to another value already in the file
         using the interpolation format.

        N)Úset_section_optionr   ©r'   rb   Úvalues      r+   Úset_main_optionzConfig.set_main_optionS  s   € ð 	×Ñ × 7Ñ 7¸¸uÕEr-   c                óP   — | j                   j                  | j                  |«       y r0   )rJ   Úremove_optionr   )r'   rb   s     r+   Úremove_main_optionzConfig.remove_main_optiond  s   € Ø×Ñ×&Ñ& t×'>Ñ'>ÀÕEr-   c                óª   — | j                   j                  |«      s| j                   j                  |«       | j                   j                  |||«       y)aW  Set an option programmatically within the given section.

        The section is created if it doesn't exist already.
        The value here will override whatever was in the .ini
        file.

        Does **NOT** consume from the pyproject.toml file.

        .. seealso::

            :meth:`.Config.get_alembic_option` - includes pyproject support

        :param section: name of the section

        :param name: name of the value

        :param value: the value.  Note that this value is passed to
         ``ConfigParser.set``, which supports variable interpolation using
         pyformat (e.g. ``%(some_value)s``).   A raw percent sign not part of
         an interpolation symbol must therefore be escaped, e.g. ``%%``.
         The given value may refer to another value already in the file
         using the interpolation format.

        N)rJ   rh   rI   Úset)r'   Úsectionrb   rm   s       r+   rk   zConfig.set_section_optiong  sD   € ð4 ×Ñ×+Ñ+¨GÔ4Ø×Ñ×(Ñ(¨Ô1Ø×Ñ×Ñ˜W d¨EÕ2r-   c                óø   — | j                   j                  |«      s&t        j                  d| j                  ›d|›d�«      ‚| j                   j                  ||«      r| j                   j                  ||«      S |S )z9Return an option from the given section of the .ini file.zNo config file z found, or file has no '[z
]' section)rJ   rh   r   rT   r   Ú
has_optionrR   )r'   rt   rb   rc   s       r+   Úget_section_optionzConfig.get_section_option…  sr   € ð ×Ñ×+Ñ+¨GÔ4Ü×#Ò#à$(×$9Ó$9º7ðDóð ð ×Ñ×&Ñ& w°Ô5Ø×#Ñ#×'Ñ'¨°Ó6Ð6àˆNr-   c                 ó   — y r0   r6   ra   s      r+   Úget_main_optionzConfig.get_main_option“  s   € Ø?Br-   c                 ó   — y r0   r6   ra   s      r+   ry   zConfig.get_main_option–  ó   € ð r-   c                ó<   — | j                  | j                  ||«      S )a‚  Return an option from the 'main' section of the .ini file.

        This defaults to being a key from the ``[alembic]``
        section, unless the ``-n/--name`` flag were used to
        indicate a different section.

        Does **NOT** consume from the pyproject.toml file.

        .. seealso::

            :meth:`.Config.get_alembic_option` - includes pyproject support

        )rw   r   ra   s      r+   ry   zConfig.get_main_option›  s   € ð  ×&Ñ& t×'>Ñ'>ÀÀgÓNÐNr-   c                 ó   — y r0   r6   ra   s      r+   Úget_alembic_optionzConfig.get_alembic_option­  s   € ØBEr-   c                 ó   — y r0   r6   ra   s      r+   r~   zConfig.get_alembic_option°  r{   r-   c                óÀ   — | j                   j                  | j                  |«      r&| j                   j                  | j                  |«      S | j	                  ||¬«      S )aÁ  Return an option from the "[alembic]" or "[tool.alembic]" section
        of the configparser-parsed .ini file (e.g. ``alembic.ini``) or
        toml-parsed ``pyproject.toml`` file.

        The value returned is expected to be None, string, list of strings,
        or dictionary of strings.   Within each type of string value, the
        ``%(here)s`` token is substituted out with the absolute path of the
        ``pyproject.toml`` file, as are other tokens which are extracted from
        the :paramref:`.Config.config_args` dictionary.

        Searches always prioritize the configparser namespace first, before
        searching in the toml namespace.

        If Alembic was run using the ``-n/--name`` flag to indicate an
        alternate main section name, this is taken into account **only** for
        the configparser-parsed .ini file.  The section name in toml is always
        ``[tool.alembic]``.


        .. versionadded:: 1.16.0

        )rc   )rJ   rv   r   rR   Ú_get_toml_config_valuera   s      r+   r~   zConfig.get_alembic_optionµ  sU   € ð4 ×Ñ×&Ñ& t×'>Ñ'>ÀÔEØ×#Ñ#×'Ñ'¨×(?Ñ(?ÀÓFÐFà×.Ñ.¨t¸WÐ.ÓEÐEr-   c                ó,  — | j                   j                  | j                  |«      r)| j                   j                  | j                  |«      dk(  S | j                  j                  |d«      }t        |t        «      st        j                  d|›�«      ‚|S )NÚtrueFz*boolean value expected for TOML parameter )	rJ   rv   r   rR   rX   rS   Úboolr   rT   rl   s      r+   Úget_alembic_boolean_optionz!Config.get_alembic_boolean_optionÔ  sŒ   € Ø×Ñ×&Ñ& t×'>Ñ'>ÀÔEà× Ñ ×$Ñ$ T×%<Ñ%<¸dÓCÀvÑMðð ×,Ñ,×0Ñ0°°uÓ=ˆEÜ˜e¤TÔ*Ü×'Ñ'Ø@ÀÀÐIóð ð ˆLr-   c                óè  — t        «       }| j                  j                  ||«      }||u r|S |��*t        |t        «      r|| j
                  z  }|S t        |t        «      r‚|rWt        |d   t        «      rD|D ���cg c]3  }|j                  «       D ��ci c]  \  }}||| j
                  z  “Œ c}}‘Œ5 }}}}|S t        d|D �cg c]  }|| j
                  z  ‘Œ c}«      }|S t        |t        «      r=t        d|j                  «       D ��ci c]  \  }}||| j
                  z  “Œ c}}«      }|S t        |t        «      r|S t        j                  d|›�«      ‚|S c c}}w c c}}}w c c}w c c}}w )Nr   ú	list[str]údict[str, str]z%unsupported TOML value type for key: )ÚobjectrX   rR   rS   r   r$   Úlistr"   ri   r   Úintr   rT   )r'   rb   rc   ÚUSE_DEFAULTrm   ÚdvÚkÚvs           r+   r�   zConfig._get_toml_config_valueá  s�  € ô “hˆà×$Ñ$×(Ñ(¨¨{Ó;ð 	ð �KÑØˆNØÑÜ˜%¤Ô%Ø §¡Ñ0�ð, ˆô+ ˜E¤4Ô(ÙœZ¨¨a©´$Ô7ñ #(õá"'˜Bð >@¿X¹X¼ZÔH¹Z±T°Q¸˜˜A §¡Ñ0Ñ0¸ZÔHØ"'ð ò ð& ˆô !Ø#ÁEÓ%JÁE¸q a¨4¯>©>Ó&:ÀEÑ%Jó�Eð ˆô ˜E¤4Ô(ÜØ$Ø9>¿¹¼ÔG¹±°°A�Q˜˜TŸ^™^Ñ,Ñ,¸ÒGó�ð ˆô ˜E¤3Ô'Ø�ä×'Ñ'Ø;¸D¸8ÐDóð ð ˆùó% Iùôùò &Kùó
 Hs$   Á<E"ÂEÂ.E"ÃE)
ÄE.ÅE"c                óv   — t        t        t        j                  dt	        | j
                  dd«      i«      «      S )zThe messaging options.ÚquietF)r   ÚMessagingOptionsr   ÚimmutabledictrE   r   r1   s    r+   r:   zConfig.messaging_opts  s7   € ô ÜÜ×ÑØœ' $§-¡-°¸%Ó@ÐAóó
ð 	
r-   c                óô   — |D ]  }| j                  |«      }|€Œ n y ddt        j                  dddœ}	 ||   }|dk(  rt        j                  d«       |S # t
        $ r}t        d|›d	|›d
�«      |‚d }~ww xY w)NÚ r8   Ú:Ú;)ÚspaceÚnewlineÚosr–   r—   Úversion_path_separatorz[The version_path_separator configuration parameter is deprecated; please use path_separatorÚ'z' is not a valid value for z-; expected 'space', 'newline', 'os', ':', ';')ry   rš   Úpathsepr   Úwarn_deprecatedÚKeyErrorÚ
ValueError)r'   Únamesrb   Ú	separatorÚsplit_on_pathÚsepÚkes          r+   Ú_get_file_separator_charzConfig._get_file_separator_char  sª   € ÛˆDØ×,Ñ,¨TÓ2ˆIØÑ$Ùð ð
 ð ØÜ—*‘*ØØñ
ˆð	Ø 	Ñ*ˆCð Ð/Ò/Ü×$Ñ$ð?ôð ˆJøô ò 	Ýò šdð$óð ð	ûð	ús   µA Á	A7ÁA2Á2A7c                ó”  — | j                   j                  | j                  dd ¬«      }|r~| j                  dd«      }|€;t	        j
                  d«       t        j                  d«      }|j                  |«      S |j                  |«      D �cg c]  }|r|j                  «       ‘Œ c}S t        d| j                  dd «      «      S c c}w )NÚversion_locations©ÚfallbackÚpath_separatorr›   z¨No path_separator found in configuration; falling back to legacy splitting on spaces/commas for version_locations.  Consider adding path_separator=os to Alembic config.ú
, *|(?: +)r‡   ©rJ   rR   r   r¦   r   rž   ÚreÚcompileÚsplitÚstripr   r�   )r'   Úversion_locations_strÚ
split_charÚ_split_on_space_commaÚxs        r+   Úget_version_locations_listz!Config.get_version_locations_list.  så   € à $× 0Ñ 0× 4Ñ 4Ø×#Ñ#Ð%8À4ð !5ó !
Ðñ !Ø×6Ñ6Ø Ð":óˆJð Ð!ô ×$Ñ$ð;ôô )+¯
©
°=Ó(AÐ%Ø,×2Ñ2Ð3HÓIÐIð 3×8Ñ8¸ÔDóáD˜Ùð —G‘G•IØDñð ô ØØ×+Ñ+Ð,?ÀÓFóð ùòs   ÂCc                ó’  — | j                   j                  | j                  dd ¬«      }|r}| j                  d«      }|€;t	        j
                  d«       t        j                  d«      }|j                  |«      S |j                  |«      D �cg c]  }|r|j                  «       ‘Œ c}S t        d| j                  dd «      «      S c c}w )NÚprepend_sys_pathr©   r«   z´No path_separator found in configuration; falling back to legacy splitting on spaces, commas, and colons for prepend_sys_path.  Consider adding path_separator=os to Alembic config.z, *|(?: +)|\:r‡   r­   )r'   Úprepend_sys_path_strr³   Ú_split_on_space_comma_colonrµ   s        r+   Úget_prepend_sys_paths_listz!Config.get_prepend_sys_paths_listQ  sß   € Ø#×/Ñ/×3Ñ3Ø×#Ñ#Ð%7À$ð  4ó  
Ðñ  Ø×6Ñ6Ð7GÓHˆJàÐ!ô ×$Ñ$ð;ôô /1¯j©jÐ9IÓ.JÐ+Ø2×8Ñ8Ð9MÓNÐNð 2×7Ñ7¸
ÔCóáC˜Ùð —G‘G•IØCñð ô ØØ×+Ñ+Ð,>ÀÓEóð ùòs   ÂCc                ó0  — g }| j                   j                  d«      sUt        d| j                  dg «      «      }|D ]2  }t	        |«      }|j                  d«      |d<   |j                  |«       Œ4 |S t        j                  d«      }| j                  di «      }|j                  |j                  dd«      «      }|D ]Q  }|sŒ|D �	ci c]+  }	|	j                  |dz   «      r|	t        |«      d	z   d  ||	   “Œ- }}	||d<   |j                  |«       ŒS |S c c}	w )
NÚpost_write_hookszlist[dict[str, str]]rb   Ú
_hook_namer¬   ÚhooksÚ Ú.r   )rJ   rh   r   r�   r"   ÚpopÚappendr®   r¯   rd   r°   rR   Ú
startswithÚlen)
r'   r¿   Útoml_hook_configÚcfgÚoptsr´   Úini_hook_configr¡   rb   Úkeys
             r+   Úget_hooks_listzConfig.get_hooks_listq  s;  € à+-ˆà×Ñ×+Ñ+Ð,>Ô?Ü#Ø&Ø×+Ñ+Ð,>ÀÓCó Ðó (�Ü˜C“y�Ø%)§X¡X¨fÓ%5��\Ñ"Ø—‘˜TÕ"ð (ð0 ˆô% %'§J¡J¨}Ó$=Ð!Ø"×.Ñ.Ð/AÀ2ÓFˆOØ)×/Ñ/Ø×#Ñ# G¨RÓ0óˆEó �ÙØñ  /óá.˜Ø—~‘~ d¨S¡jÔ1ð œ˜D›	 A™˜Ð(¨/¸#Ñ*>Ñ>Ø.ð ð ð &*��\Ñ"Ø—‘˜TÕ"ð ð ˆùòs   Ã0D)r(   ústr | os.PathLike[str] | Noner)   rÌ   r*   r   r    zTextIO | Noner!   r   r   r   r#   úMapping[str, Any]r%   zdict[str, Any] | NoneÚreturnÚNone)rÎ   zPath | None)rÎ   zdict[str, Any])r;   r   r<   r
   rÎ   rÏ   )rÎ   r   )rÎ   rÍ   )rÎ   r   )rÎ   r	   ).)rb   r   rc   rÏ   rÎ   zdict[str, str] | None)rb   r   rc   rˆ   rÎ   rˆ   )rb   r   rc   zMapping[str, str]rÎ   z"dict[str, str] | Mapping[str, str]r0   )rb   r   rc   úMapping[str, str] | NonerÎ   rÐ   )rb   r   rm   r   rÎ   rÏ   )rb   r   rÎ   rÏ   )rt   r   rb   r   rm   r   rÎ   rÏ   )rt   r   rb   r   rc   r.   rÎ   r.   )rb   r   rc   r   rÎ   r   )rb   r   rc   r.   rÎ   r.   )rb   r   rc   r.   rÎ   úDNone | str | list[str] | dict[str, str] | list[dict[str, str]] | int)rb   r   rÎ   r„   )rb   r   rc   z
Any | NonerÎ   rÑ   )rÎ   r’   )r¡   r   rÎ   r.   )rÎ   zlist[str] | None)rÎ   zlist[PostWriteHookConfig])'Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úsysr!   r   r“   r,   r   Ú__annotations__r   r   Úpropertyr2   r4   r   Úmemoized_propertyr%   r>   rJ   rX   r]   r_   r   rd   rn   rq   rk   rw   ry   r~   r…   r�   r:   r¦   r¶   r»   rË   r6   r-   r+   r   r      s^  … ñTðp 04Ø37Ø$Ø'+ØŸ™Ø%)Ø);¨×);Ñ);Ó)=Ø,0ð/à,ð/ð 1ð/ð ð	/ð
 %ð/ð ð/ð #ð/ð 'ð/ð *ð/ð 
ó/ð6 "&€HÐÓ%ð	ð $(Ð�jÓ'Ø2à!%€N�JÓ%ðð ò+ó ð+ð
 ò)ó ð)ð
 #Ð˜Ó"ðð 
×Ñòó ðó&Oð. 
×Ñòó ðð@ 
×Ñòó ðó&
.ó	3ð à),ð$Øð$Ø"&ð$à	ò$ó ð$ð ðØðØ"0ðà	òó ðð ð1Øð1Ø"3ð1à	+ò1ó ð1ð
 >Bð2Øð2Ø":ð2à	!ó2óFó"Fó3ð> >BðØðØ"%ðØ0:ðà	óð ÚBó ØBàà/3ðØðØ",ðà	òó ðð
 04ðOØðOØ",ðOà	óOð$ ÚEó ØEàà/3ðØðØ",ðà	òó ðð
 04ðFØðFØ",ðFà	MóFó>ð 04ð!Øð!Ø",ð!à	Mó!ðF 
×Ñò
ó ð
óó@!óFô@!r-   r   c                  ó   — e Zd ZU ded<   y)r’   r„   r‘   N)rÒ   rÓ   rÔ   r×   r6   r-   r+   r’   r’   ˜  s   … Ø„Kr-   r’   F)Útotalc                  ó$   — e Zd ZU dZded<   dd„Zy)ÚCommandFunctionzÏA function that may be registered in the CLI as an alembic command.
    It must be a named function and it must accept a :class:`.Config` object
    as the first argument.

    .. versionadded:: 1.15.3

    r   rÒ   c                 ó   — y r0   r6   )r'   ÚconfigÚargsÚkwargss       r+   Ú__call__zCommandFunction.__call__§  s   € È#r-   N)rß   r   rà   r
   rá   r
   rÎ   r
   )rÒ   rÓ   rÔ   rÕ   r×   râ   r6   r-   r+   rÝ   rÝ   œ  s   … ñð ƒMäMr-   rÝ   c            	      ó˜  — e Zd ZU dZdXdYd„Zi ddd eded¬	«      f“d
dd eed¬«      f“dd edd¬«      f“dd eed¬«      f“dd eed¬«      f“dd edd¬«      f“dd edd ¬«      f“d!d" eed#¬«      f“d$d% eed&¬«      f“d'd( eed)¬«      f“d*d+d, edd-¬«      f“d.d/ edd0¬«      f“d1d2 edd3¬«      f“d4d5d6 ed7d8¬«      f“d9d:d; edd<¬«      f“d=d> edd?¬«      f“d@dA eddB¬«      f“dCdDdE eddF¬«      fi¥Z edG¬H«       edI¬H«       edJdK¬L«      dMœZe	j                  dNdOiiZdPedQ<   dYdR„ZdZdS„Zd[dT„Zd\dU„Zd]dV„ZdXd^dW„Zy)_ÚCommandLinez/Provides the command line interface to Alembic.Nc                ó&   — | j                  |«       y r0   )Ú_generate_args)r'   Úprogs     r+   r,   zCommandLine.__init__­  s   € Ø×Ñ˜DÕ!r-   Útemplatez-tz
--templateÚgenericz"Setup template for use with 'init')rc   ÚtypeÚhelpÚmessagez-mz	--messagez%Message string to use with 'revision')rê   rë   Úsqlz--sqlÚ
store_truez\Don't emit SQL to database - dump to standard output/file instead. See docs on offline mode.©Úactionrë   Útagz--tagz<Arbitrary 'tag' name - can be used by custom env.py scripts.Úheadz--headzCSpecify head revision or <branchname>@head to base new revision on.Úsplicez--splicez6Allow a non-head revision as the 'head' to splice ontoÚ
depends_onz--depends-onrÃ   zNSpecify one or more revision identifiers which this revision should depend on.Úrev_idz--rev-idz9Specify a hardcoded revision id instead of generating oneÚversion_pathz--version-pathz2Specify specific path from config for version fileÚbranch_labelz--branch-labelz3Specify a branch label to apply to the new revisionrA   z-vz	--verbosezUse more verbose outputÚresolve_dependenciesz--resolve-dependenciesz+Treat dependency versions as down revisionsÚautogeneratez--autogeneratezgPopulate revision script with candidate migration operations, based on comparison of database to model.Ú	rev_rangez-rz--rev-rangeÚstorez1Specify a revision range; format is [start]:[end]Úindicate_currentz-iz--indicate-currentzIndicate the current revisionÚpurgez--purgez7Unconditionally erase the version table before stampingÚpackagez	--packagezFWrite empty __init__.py files to the environment and version locationsÚcheck_headsú-cz--check-headsziCheck if all head revisions are applied to the database. Exit with an error code if this is not the case.zlocation of scripts directory©rë   zrevision identifierÚ+z/one or more revisions, or 'heads' for all heads)Únargsrë   )Ú	directoryÚrevisionÚ	revisionsr  r  zdict[Any, dict[str, str]]Ú_POSITIONAL_TRANSLATIONSc                óÌ  — t        |¬«      }|j                  dddt        z  ¬«       |j                  dddd	¬
«       |j                  ddt        dd¬«       |j                  ddd¬
«       |j                  ddd¬
«       |j                  dddd¬
«       |j	                  «       | _        d„ d„ t        t        «      D «       D «       }|D ]  }| j                  |«       Œ || _	        y )N©rç   z	--versionÚversionz%%(prog)s %s)rð   r
  r   z--configrÃ   zÄAlternate config file; defaults to value of ALEMBIC_CONFIG environment variable, or "alembic.ini". May also refer to pyproject.toml file.  May be specified twice to reference both files separatelyrï   z-nz--namer   zfName of section in .ini file to use for Alembic config (only applies to configparser config, not toml))rê   rc   rë   z-xzlAdditional arguments consumed by custom env.py scripts, e.g. -x setting1=somesetting -x setting2=somesettingz
--raiseerrrî   z!Raise a full stack trace on errorz-qz--quietzDo not log to std output.c              3  ó¨   K  — | ]J  }t        j                  |«      r3|j                  d    dk7  r!|j                  dk(  rt	        t
        |«      –— ŒL y­w)r   Ú_zalembic.commandN)ÚinspectÚ
isfunctionrÒ   rÓ   r   rÝ   )Ú.0Úfns     r+   Ú	<genexpr>z-CommandLine._generate_args.<locals>.<genexpr>v  sJ   è ø€ ð 
áG�ä×"Ñ" 2Ô&Ø—K‘K ‘N cÒ)Ø—M‘MÐ%6Ò6ô ” "×%ÙGùs   ‚AAc              3  ó<   K  — | ]  }t        t        |«      –— Œ y ­wr0   )rE   r   )r  rb   s     r+   r  z-CommandLine._generate_args.<locals>.<genexpr>x  s   è ø€ ÐG¹,°$”wœw¨×-¹,ùs   ‚)
r   Úadd_argumentr   r   Úadd_subparsersÚ
subparsersÚdirr   Úregister_commandÚparser)r'   rç   r  Úalembic_commandsr  s        r+   ræ   zCommandLine._generate_argsK  s!  € Ü TÔ*ˆà×ÑØ 	°>ÄKÑ3Oð 	ô 	
ð 	×ÑØØØð1ð	 	ô 	
ð 	×ÑØØÜØð>ð 	ô 	
ð 	×ÑØØð;ð 	ô 	
ð 	×ÑØØØ4ð 	ô 	
ð
 	×ÑØØØØ,ð	 	ô 	
ð !×/Ñ/Ó1ˆŒñ
áG¼#¼g¼,ÔGó
Ðó #ˆBØ×!Ñ! "Õ%ð #ð ˆ�r-   c                ó”  — | j                  |«      \  }}}| j                  j                  |j                  |¬«      }|j	                  |||f¬«       |D ]<  }|| j
                  v sŒ| j
                  |   }|dd |d   }	} |j                  |i |	¤Ž Œ> |D ]1  }| j                  j                  |i «      }	 |j                  |fi |	¤Ž Œ3 y)a-  Registers a function as a CLI subcommand. The subcommand name
        matches the function name, the arguments are extracted from the
        signature and the help text is read from the docstring.

        .. versionadded:: 1.15.3

        .. seealso::

            :ref:`custom_commandline`
        r  )Úcmdr   éÿÿÿÿN)	Ú_inspect_functionr  Ú
add_parserrÒ   Úset_defaultsÚ_KWARGS_OPTSr  Ú_POSITIONAL_OPTSrR   )
r'   r  Ú
positionalÚkwargÚ	help_textÚ	subparserr<   Ú	kwarg_optrà   rÈ   s
             r+   r  zCommandLine.register_command…  sÙ   € ð (,×'=Ñ'=¸bÓ'AÑ$ˆ
�E˜9à—O‘O×.Ñ.¨r¯{©{ÀÐ.ÓKˆ	Ø×Ñ B¨
°EÐ#:ÐÔ;ãˆCØ�d×'Ñ'Ò'Ø ×-Ñ-¨cÑ2�	Ø& q¨˜_¨i¸©m�d�Ø&�	×&Ñ&¨Ð5°Ó5ð	 ó ˆCØ×(Ñ(×,Ñ,¨S°"Ó5ˆDØ"ˆI×"Ñ" 3Ñ/¨$Ó/ñ r-   c                óþ  — t        j                  |«      }|d   �+|d   dt        |d   «        }|d   t        |d   «       d  }n
|d   dd  }g }|| j                  v r,|D �cg c]!  }| j                  |   j	                  ||«      ‘Œ# }}|j
                  }|rJg }|j                  d«      D ]3  }|j                  «       s n$|j                  |j                  «       «       Œ5 ng }dj                  |«      }	|||	fS c c}w )Né   r   r   r8   r•   )
r   Úinspect_getfullargspecrÅ   r  rR   rÕ   r°   r±   rÃ   Újoin)
r'   r  Úspecr"  r#  rb   Úhelp_Ú
help_linesÚliner$  s
             r+   r  zCommandLine._inspect_function   s  € Ü×,Ñ,¨RÓ0ˆØ�‰7ÐØ˜a™ ¤c¨$¨q©'£l ]Ð3ˆJØ˜‘GœS  a¡›\˜M˜OÐ,‰Eà˜a™  ˜ˆJØˆEà�×.Ñ.Ñ.ñ 'óá&�Dð ×-Ñ-¨bÑ1×5Ñ5°d¸DÕAØ&ð ð ð —
‘
ˆÙØˆJØŸ™ DÖ)�Ø—z‘z”|Ùà×%Ñ% d§j¡j£lÕ3ñ	 *ð ˆJà—H‘H˜ZÓ(ˆ	à˜5 )Ð+Ð+ùò's   Á"&C:c                ód  — |j                   \  }}}	  ||g|D �cg c]  }t        ||d «      ‘Œ c}¢­i |D �ci c]  }|t        ||d «      “Œ c}¤Ž y c c}w c c}w # t        j                  $ r@}|j                  r‚ t        j
                  t        |«      fi |j                  ¤Ž Y d }~y d }~ww xY wr0   )r  rE   r   rT   ÚraiseerrÚerrr   r:   )r'   rß   Úoptionsr  r"  r#  rŽ   Úes           r+   Úrun_cmdzCommandLine.run_cmd¿  s¬   € Ø '§¡ÑˆˆJ˜ð
	:ÙØðá5?Ó@±Z°”'˜' 1 dÕ+°ZÑ@òñ :?Ó?¹°A�1”g˜g q¨$Ó/Ñ/¸Ñ?óùâ@ùÚ?øä× Ñ ò 	:Ø×ÒØä—‘œ˜Q›Ñ9 6×#8Ñ#8×9ûð		:ús2   ’A šA
®	A ·AÁA Á
A ÁB/Á/6B*Â*B/c                ó¦  — |j                   }t        j                  j                  d«      }|r't        j                  j                  |«      dk(  r|}d}n|rd}|}nd}d}|s||fS d x}}|D ]W  }t        j                  j                  |«      dk(  r|�t        j                  d«      ‚|}Œ?|�t        j                  d«      ‚|}ŒY |r|n||r|fS |fS )NÚALEMBIC_CONFIGzpyproject.tomlzalembic.iniz'pyproject.toml indicated more than oncez"only one ini file may be indicated)rß   rš   ÚenvironrR   ÚpathÚbasenamer   rT   )	r'   r2  r¡   Úalembic_config_envÚdefault_pyproject_tomlÚdefault_alembic_configÚtomlÚinirb   s	            r+   Ú_inis_from_configzCommandLine._inis_from_configÎ  s  € Ø—‘ˆäŸZ™ZŸ^™^Ð,<Ó=ÐáÜ—‘× Ñ Ð!3Ó4Ð8HÒHà%7Ð"Ø%2Ñ"ÙØ%5Ð"Ø%7Ñ"à%2Ð"Ø%5Ð"áØ)Ð+AÐAÐAàÐˆˆsãˆDÜ�w‰w×Ñ Ó%Ð)9Ò9ØÐ#Ü×+Ñ+ØAóð ð ‘à�?Ü×+Ñ+Ø<óð ð ‘ð ñ ‰tÐ!7ÙˆCð
ð 	
Ø2ð
ð 	
r-   c                ó  — | j                   j                  |«      }t        |d«      s| j                   j                  d«       y| j	                  |«      \  }}t        |||j                  |¬«      }| j                  ||«       y)z6Executes the command line with the provided arguments.r  ztoo few arguments)r(   r)   r*   r   N)r  Ú
parse_argsÚhasattrÚerrorr?  r   rb   r4  )r'   Úargvr2  r=  r>  rÇ   s         r+   ÚmainzCommandLine.mainö  ss   € à—+‘+×(Ñ(¨Ó.ˆÜ�w Ô&ð �K‰K×ÑÐ1Õ2à×.Ñ.¨wÓ7‰IˆD�#ÜØØØ#ŸL™LØ ô	ˆCð �L‰L˜˜gÕ&r-   r0   )rç   r.   rÎ   rÏ   )r  rÝ   rÎ   rÏ   )r  rÝ   rÎ   ztuple[Any, Any, str])rß   r   r2  r   rÎ   rÏ   )r2  r   rÎ   ztuple[str, str])rD  úSequence[str] | NonerÎ   rÏ   )rÒ   rÓ   rÔ   rÕ   r,   r"   r   r   r!  r   Ústampr  r×   ræ   r  r  r4  r?  rE  r6   r-   r+   rä   rä   ª  s  … Ù9ô"ðLØØØÙØ!ØØ9ôð
ðLð 	ØØÙ�cÐ GÔHð
ðLð 	ØÙØ#ð ôð
ðLð0 	ØÙØð)ôð
ð1Lð@ 	ØÙØð+ôð
ðALðP 	ØÙØ#ØMôð
ðQLð^ 	ØÙØð8ôð
ð_Lðn 	ØÙØð!ôð
ðoLð~ 	ØÙØØIôð
ðLðL 	ØÙØØJôð
ðMLðZ 	ØØÙ˜Ð+DÔEð
ð[Lðd 	Ø$ÙØ#ØBôð!
ðeLðr 	ØÙØ#ð(ôð
ðsLðD 	ØØÙØØHôð
ðELðT 	ØØ ÙØ#Ø4ôð
ðULðd 	ØÙØ#ØNôð
ðeLðr 	ØÙØ#ð4ôð
ðsLðB 	ØØÙØ#ðGôð

ñCL€Lñ\ Ð>Ô?ÙØ&ô
ñ ØØBô
ñ	Ðð 	�‰˜
 KÐ0ð;ÐÐ7ó ó8ót0ó6,ó>:ó&
õP'r-   rä   c                ó<   — t        |¬«      j                  | ¬«       y)z(The console runner function for Alembic.r	  )rD  N)rä   rE  )rD  rç   rá   s      r+   rE  rE    s   € ô �TÔ×Ñ TÐÕ*r-   Ú__main__)NN)rD  rF  rç   r.   rá   r
   rÎ   rÏ   )*Ú
__future__r   Úargparser   r   Úcollections.abcr   r   Úconfigparserr   r  Úloggingrš   Úpathlibr	   r®   rÖ   Útypingr
   r   r   r   r   Útyping_extensionsr   rÀ   r   r   r   r   Úutil.pyfilesr   Ú	getLoggerrÒ   rG   r   r   ÚPostWriteHookConfigr’   rÝ   rä   rE  r6   r-   r+   Ú<module>rU     sè   ðÝ "å #Ý Ý #Ý $Ý %Û Û Û 	Ý Û 	Û 
Ý Ý Ý Ý Ý å 'å Ý Ý Ý Ý 1à€g×Ñ˜Ó!€÷s	ñ s	ðl ˜c 3˜hÑ'Ð ô�y¨õ ôN�hô N÷['ñ ['ð~
 "&Øð+Ø
ð+à
ð+ð ð+ð 
ó	+ð ˆzÒÙ…Fð r-   