+
    Q(i,                         ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt  ! R R]4      t ! R R]4      t	 ! R R	]4      t
 ! R
 R]4      tRRRRRRRRRRRRR/R R llltR# )    N)Sequence)Pathc                       ] tR t^tRtRtR# )EditorErrorzVRoot editor-related error.

Root exception raised by all exceptions in :func:`.edit`.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       T/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/cyclopts/_edit.pyr   r      s    r   r   c                       ] tR t^tRtRtR# )EditorDidNotSaveErrorz-User did not save upon exiting :func:`.edit`.r   Nr   r   r   r   r   r      s    7r   r   c                       ] tR t^tRtRtR# )EditorDidNotChangeErrorz1User did not edit file contents in :func:`.edit`.r   Nr   r   r   r   r   r      s    ;r   r   c                       ] tR t^tRtRtR# )EditorNotFoundErrorz4Could not find a valid text editor for :func`.edit`.r   Nr   r   r   r   r   r      s    >r   r    fallback_editorseditor_argspathencodingzutf-8saveTrequiredc                    V ^8  d   QhR\         R\        \         ,          R\        \         ,          R\         \        ,          R\         R\        R\        R\         /# )	   initial_textr   r   r   r   r   r   return)strr   r   bool)formats   "r   __annotate__r%      sp     Q QQ smQ #	Q
 *Q Q Q Q 	Qr   c                  ^ RI p^ RIp\        P                  P	                  R4      .VO F&  p	V	'       g   K  VP                  V	4      '       g   K&   M	  \        hV'       d*   \        V4      pVP                  P                  RRR7       M,\        \        P                  ! RRRR7      P                  4      pVP                  WR	7       \        P                  ! 4       ^,
          p
\        P                  ! W:V
34       VP!                  4       p VP#                  W.VO4       VP!                  4       pV'       d"   VP$                  VP$                  8:  d   \&        hVP)                  VR	7      p TP1                  RR7       T'       d   Y8X  d   \2        hT#   TP*                   d!   p\-        T	 R
TP.                   24      ThRp?ii ; i  TP1                  RR7       i ; i)a  Get text input from a user by launching their default text editor.

Parameters
----------
initial_text: str
    Initial text to populate the text file with.
fallback_editors: Sequence[str]
    If the text editor cannot be determined from the environment variable ``EDITOR``, attempt to use these text editors in the order provided.
editor_args: Sequence[str]
    Additional CLI arguments that are passed along to the editor-launch command.
path: Union[str, Path]
    If specified, the path to the file that should be opened.
    Text editors typically display this, so a custom path may result in a better user-interface.
    Defaults to a temporary text file.
encoding: str
    File encoding to use.
save: bool
    **Require** the user to save before exiting the editor. Otherwise raises :exc:`EditorDidNotSaveError`.
required: bool
    **Require** for the saved text to be different from ``initial_text``. Otherwise raises :exc:`EditorDidNotChangeError`.

Raises
------
EditorError
    Base editor error exception. Explicitly raised if editor subcommand
    returned a non-zero exit code.
EditorNotFoundError
    A suitable text editor could not be found.
EditorDidNotSaveError
    The user exited the text-editor without saving and ``save=True``.
EditorDidNotChangeError
    The user did not change the file contents and ``required=True``.

Returns
-------
str
    The resulting text that was saved by the text editor.
NEDITORT)exist_okparentsz.txtwF)suffixmodedelete)r   z exited with status )
missing_ok)shutil
subprocessosenvirongetwhichr   r   parentmkdirtempfileNamedTemporaryFilename
write_texttimeutimestat
check_callst_mtimer   	read_textCalledProcessErrorr   
returncodeunlinkr   )r    r   r   r   r   r   r   r/   r0   editor	past_time
start_statend_statedited_textes   &$$$$$$        r   editrJ      s   ` ::>>(+?.>?6fll6** @ "!Dz46H//vCPUV[[\OOLO4		aIHHTy)*J	%v:k:;99;H%%)<)<<''nnhn7 	t$K/%% (( PVH$8GHaOP 	t$s%   AF G(GGG G)r   )nanovimnotepadgeditr   )r1   r7   r;   collections.abcr   pathlibr   	Exceptionr   r   r   r   rJ   r   r   r   <module>rR      s    	   $ ) 8K 8<k <?+ ?Q 'JQ "$	Q
 Q Q Q Q Qr   