Ë
    îÍ:j§ˆ  ã                  óè  — 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 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jD                  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)ÚConfigParserN)ÚPath)ÚAny)Úcast)ÚDict)ÚMapping)ÚOptional)Úoverload)ÚProtocol)ÚSequence)ÚTextIO)ÚUnion)Ú	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úOptional[Namespace]c	                ó  — |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	            úc/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/alembic/config.pyÚ__init__zConfig.__init__z   sƒ   € ñ /4Ô# EÔ*¸ð 	Ôñ 3<Ô# IÔ.Àð 	Ôð #.ˆÔØ*ˆÔØˆŒØ ˆŒÜ Ó,ˆÔÜ˜kÓ*ˆŒÙØ�O‰O×"Ñ" :Õ.ð ó    úOptional[str]r    r!   c                óF   — | j                   €y t        | j                   «      S ©N)r    r   ©r*   s    r.   Ú_config_file_pathzConfig._config_file_path«   s"   € à× Ñ Ð(ØÜ�D×)Ñ)Ó*Ð*r0   c                óF   — | j                   €y t        | j                   «      S r3   )r!   r   r4   s    r.   Ú_toml_file_pathzConfig._toml_file_path±   s"   € à×ÑÐ&ØÜ�D×'Ñ'Ó(Ð(r0   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`

        © r4   s    r.   r(   zConfig.attributes¿   s	   € ð$ ˆ	r0   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ÓNr0   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)r5   ÚabsoluteÚparentr   Úas_posixr&   r   Úgetattrr   r   Úread_config_parserÚlogÚinfoÚadd_sectionr"   )r*   rC   Úfile_configrD   s       r.   rM   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ôð Ðr0   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.tomlrC   ÚrbÚtoolr   zIncorrect TOML formatN)r7   ÚexistsrE   rF   rG   r'   Úopenr   ÚtomllibÚloadÚgetÚ
isinstancer%   r   ÚCommandError)r*   rC   Ú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Ø÷ñ ð ˆI÷ð ú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__rE   rF   r   )r*   r   Úpackage_dirs      r.   Úget_template_directoryzConfig.get_template_directory  s6   € ó 	ä˜7×+Ñ+Ó,×5Ñ5Ó7×>Ñ>ˆÜ�; Ñ,Ó-Ð-r0   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`   r4   s    r.   Ú_get_template_pathzConfig._get_template_path+  s   € ô �D×/Ñ/Ó1Ó2Ð2r0   c                 ó   — y r3   r9   ©r*   ÚnameÚdefaults      r.   Úget_sectionzConfig.get_section6  s   € ð $'r0   c                 ó   — y r3   r9   rd   s      r.   rg   zConfig.get_section>  s   € ð r0   c                 ó   — y r3   r9   rd   s      r.   rg   zConfig.get_sectionC  s   € ð 47r0   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.

        )rM   Úhas_sectionr%   Úitemsrd   s      r.   rg   zConfig.get_sectionH  s9   € ð ×Ñ×+Ñ+¨DÔ1ØˆNä�D×$Ñ$×*Ñ*¨4Ó0Ó1Ð1r0   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*   re   Úvalues      r.   Úset_main_optionzConfig.set_main_optionW  s   € ð 	×Ñ × 7Ñ 7¸¸uÕEr0   c                óP   — | j                   j                  | j                  |«       y r3   )rM   Úremove_optionr"   )r*   re   s     r.   Úremove_main_optionzConfig.remove_main_optionh  s   € Ø×Ñ×&Ñ& t×'>Ñ'>ÀÕEr0   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)rM   rk   rL   Úset)r*   Úsectionre   rp   s       r.   rn   zConfig.set_section_optionk  sD   € ð4 ×Ñ×+Ñ+¨GÔ4Ø×Ñ×(Ñ(¨Ô1Ø×Ñ×Ñ˜W d¨EÕ2r0   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)rM   rk   r   rW   r    Ú
has_optionrU   )r*   rw   re   rf   s       r.   Úget_section_optionzConfig.get_section_option‰  sr   € ð ×Ñ×+Ñ+¨GÔ4Ü×#Ò#à$(×$9Ó$9º7ðDóð ð ×Ñ×&Ñ& w°Ô5Ø×#Ñ#×'Ñ'¨°Ó6Ð6àˆNr0   c                 ó   — y r3   r9   rd   s      r.   Úget_main_optionzConfig.get_main_option—  s   € Ø?Br0   c                 ó   — y r3   r9   rd   s      r.   r|   zConfig.get_main_optionš  ó   € ð r0   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

        )rz   r"   rd   s      r.   r|   zConfig.get_main_optionŸ  s   € ð  ×&Ñ& t×'>Ñ'>ÀÀgÓNÐNr0   c                 ó   — y r3   r9   rd   s      r.   Úget_alembic_optionzConfig.get_alembic_option±  s   € ØBEr0   c                 ó   — y r3   r9   rd   s      r.   r�   zConfig.get_alembic_option´  r~   r0   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

        )rf   )rM   ry   r"   rU   Ú_get_toml_config_valuerd   s      r.   r�   zConfig.get_alembic_option¹  sU   € ð8 ×Ñ×&Ñ& t×'>Ñ'>ÀÔEØ×#Ñ#×'Ñ'¨×(?Ñ(?ÀÓFÐFà×.Ñ.¨t¸WÐ.ÓEÐEr0   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 )	rM   ry   r"   rU   r[   rV   Úboolr   rW   ro   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óð ð ˆLr0   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]zdict[str, str]z%unsupported TOML value type for key: )Úobjectr[   rU   rV   r   r'   Úlistr%   rl   r	   Úintr   rW   )r*   re   rf   ÚUSE_DEFAULTrp   ÚdvÚkÚvs           r.   r„   zConfig._get_toml_config_valueç  sƒ  € ô
 “hˆà×$Ñ$×(Ñ(¨¨{Ó;ð 	ð �KÑØˆNØÑÜ˜%¤Ô%Ø §¡Ñ0�ð, ˆô+ ˜E¤4Ô(ÙœZ¨¨a©´$Ô7ð #(÷ð àð >@¿X¹X»Z×H±T°Q¸˜˜A §¡Ñ0Ñ0ÕHð�Eò ð& ˆô !Ø#ÀEÖ%J¸q a¨4¯>©>Ó&:Ò%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   ÚimmutabledictrH   r   r4   s    r.   r=   zConfig.messaging_opts  s7   € ô ÜÜ×ÑØœ' $§-¡-°¸%Ó@ÐAóó
ð 	
r0   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ú r;   ú:ú;)Ú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', ':', ';')r|   rœ   Úpathsepr   Úwarn_deprecatedÚKeyErrorÚ
ValueError)r*   Únamesre   Ú	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Š   ©rM   rU   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_list6  sà   € à $× 0Ñ 0× 4Ñ 4Ø×#Ñ#Ð%8À4ð !5ó !
Ðñ !Ø×6Ñ6Ø Ð":óˆJð Ð!ô ×$Ñ$ð;ôô )+¯
©
°=Ó(AÐ%Ø,×2Ñ2Ð3HÓIÐIð 3×8Ñ8¸ÓDöàÙð —G‘G•Iòð ô ØØ×+Ñ+Ð,?ÀÓ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_listY  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öàÙð —G‘G•Iòð ô ØØ×+Ñ+Ð,>ÀÓ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]]re   Ú
_hook_namer®   ÚhooksÚ ú.r   )rM   rk   r	   r„   r%   ÚpopÚappendr°   r±   rg   r²   rU   Ú
startswithÚlen)
r*   rÁ   Útoml_hook_configÚcfgÚoptsr¶   Úini_hook_configr£   re   Úkeys
             r.   Úget_hooks_listzConfig.get_hooks_listy  sB  € à+-ˆà×Ñ×+Ñ+Ð,>Ô?Ü#Ø&Ø×+Ñ+Ð,>ÀÓ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+   ú"Union[str, os.PathLike[str], None]r,   rÎ   r-   r   r#   zOptional[TextIO]r$   r   r   r   r&   úMapping[str, Any]r(   zOptional[Dict[str, Any]]ÚreturnÚNone)rÐ   zOptional[Path])rÐ   zDict[str, Any])r>   r   r?   r   rÐ   rÑ   )rÐ   r   )rÐ   rÏ   )rÐ   r   )rÐ   r   ).)re   r   rf   rÑ   rÐ   zOptional[Dict[str, str]])re   r   rf   úDict[str, str]rÐ   rÒ   )re   r   rf   zMapping[str, str]rÐ   z(Union[Dict[str, str], Mapping[str, str]]r3   )re   r   rf   úOptional[Mapping[str, str]]rÐ   rÓ   )re   r   rp   r   rÐ   rÑ   )re   r   rÐ   rÑ   )rw   r   re   r   rp   r   rÐ   rÑ   )rw   r   re   r   rf   r1   rÐ   r1   )re   r   rf   r   rÐ   r   )re   r   rf   r1   rÐ   r1   )re   r   rf   r1   rÐ   úFUnion[None, str, list[str], dict[str, str], list[dict[str, str]], int])re   r   rÐ   r‡   )re   r   rf   zOptional[Any]rÐ   rÔ   )rÐ   r”   )r£   r   rÐ   r1   )rÐ   zOptional[list[str]])rÐ   zlist[PostWriteHookConfig])'Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úsysr$   r   r•   r/   r   Ú__annotations__r    r!   Úpropertyr5   r7   r"   Úmemoized_propertyr(   rA   rM   r[   r`   rb   r   rg   rq   rt   rn   rz   r|   r�   rˆ   r„   r=   r¨   r¸   r½   rÍ   r9   r0   r.   r   r   #   se  … ñTðp 59Ø8<Ø$Ø*.ØŸ™Ø(,Ø);¨×);Ñ);Ó)=Ø/3ð/à1ð/ð 6ð/ð ð	/ð
 (ð/ð ð/ð &ð/ð 'ð/ð -ð/ð 
ó/ð6 %)€HÐ!Ó(ð	ð '+Ð�mÓ*Ø2à$(€N�MÓ(ðð ò+ó ð+ð
 ò)ó ð)ð
 #Ð˜Ó"ðð 
×Ñòó ðó&Oð. 
×Ñòó ðð@ 
×Ñòó ðó&
.ó	3ð à),ð'Øð'Ø"&ð'à	!ò'ó ð'ð ðØðØ"0ðà	òó ðð ð7Øð7Ø"3ð7à	1ò7ó ð7ð
 AEð2Øð2Ø"=ð2à	$ó2óFó"Fó3ð> AEðØðØ"%ðØ0=ðà	óð ÚBó ØBàà26ðØðØ"/ðà	òó ðð
 37ðOØðOØ"/ðOà	óOð$ ÚEó ØEàà26ðØðØ"/ðà	òó ðð
 37ðFØðFØ"/ðFð
óFóBð 37ð#Øð#Ø"/ð#ð
ó#ðJ 
×Ñò
ó ð
óó@!óFô@!r0   r   c                  ó   — e Zd ZU ded<   y)r”   r‡   r“   N)rÕ   rÖ   r×   rÚ   r9   r0   r.   r”   r”      s   … Ø„Kr0   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 r3   r9   )r*   ÚconfigÚargsÚkwargss       r.   Ú__call__zCommandFunction.__call__¯  s   � r0   N)râ   r   rã   r   rä   r   rÐ   r   )rÕ   rÖ   r×   rØ   rÚ   rå   r9   r0   r.   rà   rà   ¤  s   … ñð ƒMäMr0   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 r3   )Ú_generate_args)r*   Úprogs     r.   r/   zCommandLine.__init__µ  s   € Ø×Ñ˜DÕ!r0   Útemplatez-tz
--templateÚgenericz"Setup template for use with 'init')rf   Ú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 revisionrD   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í   rf   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>~  sJ   è ø€ ò 
àä×"Ñ" 2Ô&Ø—K‘K ‘N cÒ)Ø—M‘MÐ%6Ò6ô ” "×%ñ
ùs   ‚AAc              3  ó<   K  — | ]  }t        t        |«      –— Œ y ­wr3   )rH   r   )r  re   s     r.   r  z-CommandLine._generate_args.<locals>.<genexpr>€  s   è ø€ ÒG°$”wœw¨×-ÑGùs   ‚)
r   Úadd_argumentr   r   Úadd_subparsersÚ
subparsersÚdirr   Úregister_commandÚparser)r*   rê   r  Úalembic_commandsr  s        r.   ré   zCommandLine._generate_argsS  s&  € Ü TÔ*ˆà×ÑØ 	°>ÄKÑ3Oð 	ô 	
ð 	×ÑØØØð1ð	 	ô 	
ð 	×ÑØØÜØð>ð 	ô 	
ð 	×ÑØØð;ð 	ô 	
ð 	×ÑØØØ4ð 	ô 	
ð
 	×ÑØØØØ,ð	 	ô 	
ð !×/Ñ/Ó1ˆŒñ
áG¼#¼g»,ÔGô
Ðð #ò 	&ˆBØ×!Ñ! "Õ%ð	&ð ˆ�r0   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_OPTSrU   )
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Ð#:ÐÔ;àò 	6ˆCØ�d×'Ñ'Ò'Ø ×-Ñ-¨cÑ2�	Ø& q¨˜_¨i¸©m�d�Ø&�	×&Ñ&¨Ð5°Ó5ð		6ð ò 	0ˆCØ×(Ñ(×,Ñ,¨S°"Ó5ˆDØ"ˆI×"Ñ" 3Ñ/¨$Ó/ñ	0r0   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   r;   r—   )
r   Úinspect_getfullargspecrÇ   r
  rU   rØ   r²   r³   rÅ   Újoin)
r*   r  Úspecr%  r&  re   Ú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à�×.Ñ.Ñ.ð 'öàð ×-Ñ-¨bÑ1×5Ñ5°d¸DÕAðˆJð ð —
‘
ˆÙØˆJØŸ™ DÓ)ò 4�Ø—z‘z”|Ùà×%Ñ% d§j¡j£lÕ3ñ	4ð ˆ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r3   )r  rH   r   rW   ÚraiseerrÚerrr   r=   )r*   râ   Úoptionsr  r%  r&  r�   Úes           r.   Úrun_cmdzCommandLine.run_cmdÇ  s¤   € Ø '§¡ÑˆˆJ˜ð
	:ÙØðà5?Ö@°”'˜' 1 dÕ+Ò@òð :?Ö?°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œ   ÚenvironrU   ÚpathÚbasenamer   rW   )	r*   r5  r£   Úalembic_config_envÚdefault_pyproject_tomlÚdefault_alembic_configÚtomlÚinire   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ð
ð 	
r0   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ÚerrorrB  r   re   r7  )r*   Úargvr5  r@  rA  rÉ   s         r.   ÚmainzCommandLine.mainþ  ss   € à—+‘+×(Ñ(¨Ó.ˆÜ�w Ô&ð �K‰K×ÑÐ1Õ2à×.Ñ.¨wÓ7‰IˆD�#ÜØØØ#ŸL™LØ ô	ˆCð �L‰L˜˜gÕ&r0   r3   )rê   r1   rÐ   rÑ   )r  rà   rÐ   rÑ   )r  rà   rÐ   ztuple[Any, Any, str])râ   r   r5  r   rÐ   rÑ   )r5  r   rÐ   ztuple[str, str])rG  úOptional[Sequence[str]]rÐ   rÑ   )rÕ   rÖ   r×   rØ   r/   r%   r   r#  r$  r   Ústampr
  rÚ   ré   r  r   r7  rB  rH  r9   r0   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'r0   rç   c                ó<   — t        |¬«      j                  | ¬«       y)z(The console runner function for Alembic.r  )rG  N)rç   rH  )rG  rê   rä   s      r.   rH  rH    s   € ô �TÔ×Ñ TÐÕ*r0   Ú__main__)NN)rG  rI  rê   r1   rä   r   rÐ   rÑ   ),Ú
__future__r   Úargparser   r   Úconfigparserr   r  Úloggingrœ   Úpathlibr   r°   rÙ   Útypingr   r	   r
   r   r   r   r   r   r   r   Útyping_extensionsr   rÂ   r   r   r   r   Úutil.pyfilesr   Ú	getLoggerrÕ   rJ   r   r   ÚPostWriteHookConfigr”   rà   rç   rH  r9   r0   r.   ú<module>rW     só   ðÝ "å #Ý Ý %Û Û Û 	Ý Û 	Û 
Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý å 'å Ý Ý Ý Ý 1ð €g×Ñ˜Ó!€÷w	ñ w	ðt ˜c 3˜hÑ'Ð ô�y¨õ ôN�hô N÷['ñ ['ð~
 %)Øð+Ø
!ð+à
ð+ð ð+ð 
ó	+ð ˆzÒÙ…Fð r0   