bg8UddlmZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddlm Z dd lm Z d d l mZd d lmZd ZiZded<d'dZd(dZd)dZd*d!Zed" d+d,d&ZdS)-) annotationsN)Any)Callable)Dict)List)Mapping)Optional)Union)util)compatREVISION_SCRIPT_FILENAMEdict _registrynamestrreturnrcfd}|S)zA function decorator that will register that function as a write hook. See the documentation linked below for an example. .. versionadded:: 1.2.0 .. seealso:: :ref:`post_write_hooks_custom` c|t<|S)N)r)fnrs Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/script/write_hooks.pydecoratezregister..decorate%s $ )rrs` rregisterrs# OrrevisionoptionsMapping[str, Union[str, int]]rc t|}|||S#t$r}tjd|z|d}~wwxYw)a7Invokes the formatter registered for the given name. :param name: The name of a formatter in the registry :param revision: A :class:`.MigrationRevision` instance :param options: A dict containing kwargs passed to the specified formatter. :raises: :class:`alembic.util.CommandError` z&No formatter with name '%s' registeredN)rKeyErrorr CommandError)rrrhookkes r_invoker$,se' tHg&&&  4t ;   s  A=Apath hook_configMapping[str, str]Nonecddlm}|dd}|D]sfdD}|d< |d}t jdd 5t |||d d d n #1swxYwYb#t$r }t jd d |d }~wwxYwd S)z&Invoke hooks for a generated revision.)_split_on_space_commahooksci|];}|dz|tdzd|z_run_hooks..KsY   ~~dSj)) D A  +c"2   r _hook_nametypez Running post write hook {name!r}T)newlineNKey z&.type is required for post write hook ) baser+splitgetr statusr$r r!)r%r&r+namesoptstype_r#rs ` @r _run_hooksr@Asn,+++++ ! ' ' (D(D E EE++       "    "\ +LE ?NNN + +tT*** + + + + + + + + + + + + + + +    ##DHDD$$O  ++s*B,B  B B  C B;;Ccmdline_options_str List[str]ct|vr tdz|z}tj|tj}fd|D}|S)zParse options from a string into a list. Also substitutes the revision script token with the actual filename of the revision script. If the revision script token doesn't occur in the options string, it is automatically prepended.  )posixcFg|]}|tSr)replaceREVISION_SCRIPT_TOKEN)r2optionr%s r z*_parse_cmdline_options..js8  ,d33r)rHshlexr:r is_posix)rAr%cmdline_options_lists ` r_parse_cmdline_optionsrN\sq$7773c9rfs"""""""  3 *''''*++++6    *  49$$$$$$$r