
    +"                        S SK Jr  SSKJrJr  SSKJr  SSKJrJ	r	  SSK
JrJr  SSKJr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  SSKJr  SSKJr  SSK J!r!J"r"  S SK#r#Sr$ " S S\%5      r& " S S\%5      r'g)    )unicode_literals   )BufferAcceptAction)BufferMapping)	ClipboardInMemoryClipboard)DEFAULT_BUFFEREditingMode)	CLIFilterto_cli_filter)load_basic_bindings)load_emacs_bindings)load_vi_bindings)BaseRegistry)load_key_bindings)Window)	Container)BufferControl)DEFAULT_STYLEStyleN)AbortActionApplicationc                   .    \ rS rSrSrSrSrSr\\\4rSr	g)r      z0
Actions to take on an Exit or Abort exception.
retryzraise-exceptionzreturn-none N)
__name__
__module____qualname____firstlineno____doc__RETRYRAISE_EXCEPTIONRETURN_NONE_all__static_attributes__r       -lib/third_party/prompt_toolkit/application.pyr   r      s$     E'OK?K0Dr(   r   c                       \ rS rSrSrSSS\SSS\R                  \R                  SSSSS\R                  SSSSSSSSSS4S jr
Srg)r   $   a	  
Application class to be passed to a
:class:`~prompt_toolkit.interface.CommandLineInterface`.

This contains all customizable logic that is not I/O dependent.
(So, what is independent of event loops, input and output.)

This way, such an :class:`.Application` can run easily on several
:class:`~prompt_toolkit.interface.CommandLineInterface` instances, each
with a different I/O backends. that runs for instance over telnet, SSH or
any other I/O backend.

:param layout: A :class:`~prompt_toolkit.layout.containers.Container` instance.
:param buffer: A :class:`~prompt_toolkit.buffer.Buffer` instance for the default buffer.
:param initial_focussed_buffer: Name of the buffer that is focussed during start-up.
:param key_bindings_registry:
    :class:`~prompt_toolkit.key_binding.registry.BaseRegistry` instance for
    the key bindings.
:param clipboard: :class:`~prompt_toolkit.clipboard.base.Clipboard` to use.
:param on_abort: What to do when Control-C is pressed.
:param on_exit: What to do when Control-D is pressed.
:param use_alternate_screen: When True, run the application on the alternate screen buffer.
:param get_title: Callable that returns the current title to be displayed in the terminal.
:param erase_when_done: (bool) Clear the application output when it finishes.
:param reverse_vi_search_direction: Normally, in Vi mode, a '/' searches
    forward and a '?' searches backward. In readline mode, this is usually
    reversed.

Filters:

:param mouse_support: (:class:`~prompt_toolkit.filters.CLIFilter` or
    boolean). When True, enable mouse support.
:param paste_mode: :class:`~prompt_toolkit.filters.CLIFilter` or boolean.
:param ignore_case: :class:`~prompt_toolkit.filters.CLIFilter` or boolean.
:param editing_mode: :class:`~prompt_toolkit.enums.EditingMode`.

Callbacks (all of these should accept a
:class:`~prompt_toolkit.interface.CommandLineInterface` object as input.)

:param on_input_timeout: Called when there is no input for x seconds.
                (Fired when any eventloop.onInputTimeout is fired.)
:param on_start: Called when reading input starts.
:param on_stop: Called when reading input ends.
:param on_reset: Called during reset.
:param on_buffer_changed: Called when the content of a buffer has been changed.
:param on_initialize: Called after the
    :class:`~prompt_toolkit.interface.CommandLineInterface` initializes.
:param on_render: Called right after rendering.
:param on_invalidate: Called when the UI has been invalidated.
NFc                    [        U5      n[        U5      n[        U5      n[        U5      nUb  [        U[        5      (       d   eUb  [        U[        5      (       d   eUb  [        U[        [
        45      (       d   eUb  [        U[        5      (       d   eUb  [        U[        5      (       d   eU[        R                  ;   d   eU	[        R                  ;   d   e[        U
[        5      (       d   eUb  [        U5      (       d   e[        U[        5      (       d   e[        U[        5      (       d   e[        U[        R                  5      (       d   eUb  [        U5      (       d   eUb  [        U[        5      (       d   e[        U[        5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eUb  [        U5      (       d   eU=(       d    [!        [#        5       5      U l        U=(       d    [        [&        R(                  S9U l        U(       a  [        U[
        5      (       d  [        X4S9U l        OX0l        U(       a  X R,                  [.        '   X@l        U=(       d    [2        U l        Uc
  [7        5       nUc  S nX`l        U=(       d
    [;        5       U l        Xl        Xl         Xl!        Xl"        Xl#        Xl$        Xl%        Xl&        UU l'        UU l(        S nU=(       d    UU l)        U=(       d    UU l*        U=(       d    UU l+        U=(       d    UU l,        U=(       d    UU l-        U=(       d    UU l.        U=(       d    UU l/        U=(       d    UU l0        / U l1        g )N)accept_action)initialc                      g )Nr   r   r(   r)   <lambda>&Application.__init__.<locals>.<lambda>   s    r(   c                     g)zDummy event handler. Nr   )clis    r)   dummy_handler+Application.__init__.<locals>.dummy_handler   s    r(   )2r   
isinstancer   r   dictr   r   r   r   r&   boolcallabler   sixstring_typesr   r   r   layoutr   IGNOREbufferbuffersr
   initial_focussed_bufferr   styler   key_bindings_registryr	   	clipboardon_aborton_exituse_alternate_screenmouse_support	get_title
paste_modeignore_caseediting_modeerase_when_donereverse_vi_search_directionon_input_timeouton_starton_stopon_reseton_initializeon_buffer_changed	on_renderon_invalidatepre_run_callables)selfr<   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r4   s                              r)   __init__Application.__init__W   sd     #:.
#K0%m4&34O&P#~FI!>!>>>~FF!;!;;;*Wt]6K"L"LLL$,
;PR^0_0___ Jy)$D$DDD;++++++*****.5555 HY$7$777*i0000+y1111,(8(89999'84D+E+EEE}
5% 8 888/400008H#5#555(7"3"3338H#5#555 (H5F,G,GGG$(?(??? HY$7$777$(?(???7} 7 I\5H5H Ij-@@(RDL"L+1LL('>$+m
 ($5$7!$I%:""9&7&9 $8!*"$&(.+F(	% !1 AM 1M/- 1M*;m!2!Cm"3m*;m "$r(   )r>   r?   rC   rK   rL   rH   rJ   r@   rB   r<   rG   rD   rS   rE   rR   rN   rU   rT   rQ   rO   rP   rI   rV   rM   rA   rF   )r   r   r    r!   r"   r
   r   r$   r   EMACSrX   r'   r   r(   r)   r   r   $   sa    1d #4)7'+t%55{?Z?Z&+5!u;CTCT!&-2"&tddti$r(   r   )(
__future__r   r>   r   r   buffer_mappingr   rC   r   r	   enumsr
   r   filtersr   r   key_binding.bindings.basicr   key_binding.bindings.emacsr   key_binding.bindings.vir   key_binding.registryr   key_binding.defaultsr   r<   r   layout.containersr   layout.controlsr   stylesr   r   r:   __all__objectr   r   r   r(   r)   <module>ri      sV    ' ( ) 3 . - ; ; 5 . 3  ( * ( 
1& 1\$& \$r(   