Files
ServerSync/lib/prompt_toolkit/__pycache__/renderer.cpython-314.pyc

219 lines
33 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<EFBFBD>r<00><01><><00>Rt^RIHt^RIHtHtHtHtHt^RI H
t
^RI H t ^RI HtHtHtHtHt^RIHt^RIHt^RIHtHt^R IHtHt^R
IHtHt^R I H!t!^R I"H#t#H$t$H%t%^R I&H't'H(t(^RI)H*t*H+t+H,t,H-t-]'d ^RI.H/t/^RI0H1t1RR.t2RRlt3!RR]44t5!RR]]6]*3,4t7!RR]]6]83,4t9!RR] 4t:!RR4t;R!RR llt<R#)"z_
Renders the command line on the console.
(Redraws parts of the input line that were changed.)
)<01> annotations)<05>FIRST_COMPLETED<45>Future<72> ensure_future<72>sleep<65>wait)<01>deque)<01>Enum)<05> TYPE_CHECKING<4E>Any<6E>Callable<6C>Dict<63>Hashable)<01>get_app)<01> CursorShape)<02>Point<6E>Size)<02> FilterOrBool<6F> to_filter)<02>AnyFormattedText<78>to_formatted_text)<01> MouseHandlers)<03>Char<61>Screen<65> WritePosition)<02>
ColorDepth<EFBFBD>Output)<04>Attrs<72> BaseStyle<6C>DummyStyleTransformation<6F>StyleTransformation)<01> Application)<01>Layout<75>Renderer<65>print_formatted_textc<01>P<00>V^8<>dQhRRRRRRRRR R
R R R RRRRRRRRRRRRRRR/#)<1C><00>app<70>Application[Any]<5D>outputr<00>screenr<00> current_posr<00> color_depthr<00>previous_screen<65> Screen | None<6E>
last_stylez
str | None<6E>is_done<6E>bool<6F> full_screen<65>attrs_for_style_string<6E>_StyleStringToAttrsCache<68>style_string_has_style<6C>_StyleStringHasStyleCache<68>sizer<00>previous_width<74>int<6E>returnztuple[Point, str | None]<5D>)<01>formats"<22>>/tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/renderer.py<70> __annotate__r>'s<><00><00>`#<23>`#<23> <19>`#<23> <12>`#<23> <13>`#<23><17> `#<23>
<1C> `#<23> #<23> `#<23><1B>`#<23><12>`#<23><16>`#<23>5<>`#<23>6<>`#<23> <0F>`#<23><18>`#<23><1E>`#<23>c <05><>aaaa a
aaa a!a"a#a$a%<25>V PV Puo$p VPo%VPpVPo"VP
o!VP oVPo VPoVP4RV!V3Rllo#RVVV VV#V$V%3RllpRV"V VVV%3RllpRV
3RllpV'gS#!4V'd V'gVP4V'gV'dV S$8wd5V!\^^R 74oS#!4VP4\4p\VPV 4p\\!VPVP4V 4p\#V4EF<>pVP$V,pVP$V,pVP&V,p\S$^,
V!V44p\S$^,
V!V44p^pVV8:d<>VV,pVV,pVP(;'g^pVP*VP*8wgVP,VP,8wdZV!\VVR 74oVV9dV!VV,4V!V4\SP.V,SP0R 7oVV, pK<>V'gEKEVV8gEKOV!\V^,VR 74oS#!4VP34EK<> VVP8<>dV!\^V^,
R 74oV'd%V!\^VR 74oVP4M+V!VP5VP6P844oV'g V'gVP;4S#!4VP<'dVP=4SS3#)
a`
Render the diff between this screen and the previous screen.
This takes two `Screen` instances. The one that represents the output like
it was during the last rendering and one that represents the current
output raster. Looking at these two `Screen` instances, this function will
render the difference by calling the appropriate methods of the `Output`
object that only paint the changes to the terminal.
This is some performance-critical code which is heavily optimized.
Don't change things without profiling first.
:param current_pos: Current cursor position.
:param last_style: The style string, used for drawing the last drawn
character. (Color/attributes.)
:param attrs_for_style_string: :class:`._StyleStringToAttrsCache` instance.
:param width: The width of the terminal.
:param previous_width: The width of the terminal during the last rendering.
c<01><00>V^8<>dQhRR/#<00>r&r:<00>Noner;)r<s"r=r><00>)_output_screen_diff.<locals>.__annotate__Zs<00><00><1A><1A>d<EFBFBD>r?c<05><<02>S!4RoR#)z'Wrapper around Output.reset_attributes.Nr;)<02>_output_reset_attributesr/s<00><>r=<00>reset_attributes<65>-_output_screen_diff.<locals>.reset_attributesZs<00><><00> !<21>"<22><19>
r?c<01> <00>V^8<>dQhRRRR/#)r&<00>newrr:r;)r<s"r=r>rD`s<00><00><13><13><15><13>5<EFBFBD>r?c<05>><<07>SPSPr!VPV8<>d>S!4S !RVPV,
,4^pS!VP4V#VPV8dS!W P,
4VS^,
8<>dS !R4S!VP4V#VPV8gVS^,
8<>dS!WP,
4V#VPV8<>dS!VPV,
4V#)z9Move cursor to this `new` point. Returns the given Point.<2E>
<EFBFBD> <0A><02>x<>y)
rJ<00> current_x<5F> current_y<5F>_output_cursor_backward<72>_output_cursor_forward<72>_output_cursor_upr+rG<00>width<74>writes
& <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>r=<00> move_cursor<6F>(_output_screen_diff.<locals>.move_cursor`s<><00><><00>*<2A>}<7D>}<7D>k<EFBFBD>m<EFBFBD>m<EFBFBD>9<EFBFBD> <0E>5<EFBFBD>5<EFBFBD>9<EFBFBD> <1C>
<1D> <1E> <11>&<26>C<EFBFBD>E<EFBFBD>E<EFBFBD>I<EFBFBD>-<2D>.<2E> /<2F><19>I<EFBFBD> "<22>3<EFBFBD>5<EFBFBD>5<EFBFBD> )<29><16>J<EFBFBD> <10>U<EFBFBD>U<EFBFBD>Y<EFBFBD> <1E> <1D>i<EFBFBD>%<25>%<25>/<2F> 0<> <14><05><01> <09> !<21> <11>$<24>K<EFBFBD> "<22>3<EFBFBD>5<EFBFBD>5<EFBFBD> )<29> <13>
<EFBFBD> <11>U<EFBFBD>U<EFBFBD>Y<EFBFBD> <1E>)<29>u<EFBFBD>q<EFBFBD>y<EFBFBD>"8<> #<23>I<EFBFBD><05><05>$5<> 6<><13>
<EFBFBD><11>U<EFBFBD>U<EFBFBD>Y<EFBFBD> <1E> "<22>3<EFBFBD>5<EFBFBD>5<EFBFBD>9<EFBFBD>#4<> 5<><12>
r?c<01> <00>V^8<>dQhRRRR/#)r&<00>charrr:rCr;)r<s"r=r>rD{s<00><00>$<24>$<24>$<24>$<24>4<EFBFBD>$r?c<05><><<05>SVP8XdS!VP4R#SVP,pS'dVSS,8wd
S!VS4S!VP4VPoR#)z%
Write the output of this character.
N)<02>styler[)r[<00> new_attrs<72>_output_set_attributesr3r,r/rWs& <20><><EFBFBD><EFBFBD><EFBFBD>r=<00> output_char<61>(_output_screen_diff.<locals>.output_char{s\<00><><00> <16><14><1A><1A> #<23> <11>$<24>)<29>)<29> <1C> /<2F>t<EFBFBD>z<EFBFBD>z<EFBFBD>:<3A>I<EFBFBD><1D><19>.D<>Z<EFBFBD>.P<>!P<>&<26>y<EFBFBD>+<2B>><3E> <11>$<24>)<29>)<29> <1C><1D><1A><1A>Jr?c<01> <00>V^8<>dQhRRRR/#)r&<00>rowzdict[int, Char]r:r9r;)r<s"r=r>rD<00>s<00><00>'<27>'<27>/<2F>'<27>c<EFBFBD>'r?c<05>R<<01>V3RlVP44p\V^R7#)a<>
Return max used column index, ignoring whitespace (without style) at
the end of the line. This is important for people that copy/paste
terminal output.
There are two reasons we are sometimes seeing whitespace at the end:
- `BufferControl` adds a trailing space to each line, because it's a
possible cursor position, so that the line wrapping won't change if
the cursor position moves around.
- The `Window` adds a style class to the current line for highlighting
(cursor-line).
c3<01><><"<00>TF5wrVPR8wgSVP,'gK1Vx<00>K7 R#5i)<02> N)r[r])<04>.0<EFBFBD>index<65>cellr5s& <20>r=<00> <genexpr><3E>D_output_screen_diff.<locals>.get_max_column_index.<locals>.<genexpr><3E>s7<00><><00><00>
<EFBFBD>*<2A> <0B><05><13>y<EFBFBD>y<EFBFBD>C<EFBFBD><1F>#9<>$<24>*<2A>*<2A>#E<>#E<> <12>E<EFBFBD>*<2A>s
<00>.A<01>
A)<01>default)<02>items<6D>max)rc<00>numbersr5s& <20>r=<00>get_max_column_index<65>1_output_screen_diff.<locals>.get_max_column_index<65>s'<00><><00>
<EFBFBD>"<22>y<EFBFBD>y<EFBFBD>{<7B>
<EFBFBD><07>
<13>7<EFBFBD>A<EFBFBD>&<26>&r?rN)<1F>columns<6E>rowsrW<00> write_raw<61>set_attributesrG<00>cursor_forward<72> cursor_up<75>cursor_backward<72> hide_cursor<6F>disable_autowrapr<00>
erase_downr<00>min<69>heightrn<00>range<67> data_buffer<65>zero_width_escapesrVr[r]rOrP<00>erase_end_of_line<6E>get_cursor_position<6F>layout<75>current_window<6F>enable_autowrap<61> show_cursor)&r'r)r*r+r,r-r/r0r2r3r5r7r8r}rtrXr`rp<00>current_height<68> row_countrP<00>new_row<6F> previous_row<6F>zero_width_escapes_row<6F>new_max_line_len<65>previous_max_line_len<65>c<>new_char<61>old_char<61>
char_widthrSrTrUrFr_rGrVrWs&&&&ff&f&&ff&& @@@@@@@@r=<00>_output_screen_diffr<66>'s<00><><EFBFBD><00>D<19>L<EFBFBD>L<EFBFBD>$<24>)<29>)<29>M<EFBFBD>E<EFBFBD>6<EFBFBD> <13>L<EFBFBD>L<EFBFBD>E<EFBFBD><16> <20> <20>I<EFBFBD>$<24>2<>2<><1A>%<25>6<>6<><1C>#<23>2<>2<><1A><1E>(<28>(<28><15>$<24>4<>4<><1B> <0B><16><16><18><1A><1A> <13><13>6$<24>$<24>,'<27>'<27>* <1B><18><1A> <1B>+<2B><0E><1F><1F>!<21>
<10><EFBFBD>.<2E>E<EFBFBD>*A<>!<21>%<25>!<21>q<EFBFBD>/<2F>2<> <0B><18><1A><0E><19><19><1B> <20>(<28><0F>
<19><16><1D><1D><06>/<2F>N<EFBFBD><14>C<EFBFBD><06> <0A> <0A><EFBFBD>'=<3D>'=<3D>><3E><06>G<>I<EFBFBD> <12>9<EFBFBD> <1D><01><18>$<24>$<24>Q<EFBFBD>'<27><07>&<26>2<>2<>1<EFBFBD>5<> <0C>!'<27>!:<3A>!:<3A>1<EFBFBD>!=<3D><1E><1E>u<EFBFBD>q<EFBFBD>y<EFBFBD>*><3E>w<EFBFBD>*G<>H<><18> #<23>E<EFBFBD>A<EFBFBD>I<EFBFBD>/C<>L<EFBFBD>/Q<> R<><1D> <0E><01><0F>#<23>#<23><1E>q<EFBFBD>z<EFBFBD>H<EFBFBD>#<23>A<EFBFBD><EFBFBD>H<EFBFBD>!<21><1E><1E>,<2C>,<2C>1<EFBFBD>J<EFBFBD>
<18>}<7D>}<7D><08> <0A> <0A>-<2D><18><1E><1E>8<EFBFBD>><3E>><3E>1Q<31>)<29>%<25>!<21>q<EFBFBD>/<2F>:<3A> <0B><15>.<2E>.<2E><1D>4<>Q<EFBFBD>7<>8<><1B>H<EFBFBD>%<25>#<23>k<EFBFBD>m<EFBFBD>m<EFBFBD>j<EFBFBD>&@<40>K<EFBFBD>M<EFBFBD>M<EFBFBD>R<> <0B> <0A><1A>O<EFBFBD>A<EFBFBD> <1B>?<3F>/<2F>2G<32>G<>%<25>e<EFBFBD>.><3E><11>.B<>a<EFBFBD>&H<>I<>K<EFBFBD> <1C> <1E> <12> $<24> $<24> &<26>E<1E>\<16><0F>.<2E>.<2E>.<2E>!<21>%<25>!<21>~<7E><01>/A<>"B<>C<> <0B><0F>!<21>%<25>!<21>~<7E>"><3E>?<3F> <0B><0E><19><19><1B>!<21>&<26>"<<3C>"<<3C>S<EFBFBD>Z<EFBFBD>Z<EFBFBD>=V<>=V<>"W<>X<> <0B><0E>k<EFBFBD><0E><1E><1E> <20> <15><16> <0A><19><19><19><0E><1A><1A><1C> <16>
<EFBFBD> "<22>"r?c<01><00>]tRtRtRtRtR#)<05>HeightIsUnknownErrori
z>Information unavailable. Did not yet receive the CPR response.r;N)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__<5F>__static_attributes__r;r?r=r<>r<>
s<00><00>Dr?r<>c<01>2<00>]tRtRtRtRRltRRltRtR#) r4iz_
A cache structure that maps style strings to :class:`.Attr`.
(This is an important speed up.)
c<01>$<00>V^8<>dQhRRRRRR/#)r&<00>get_attrs_for_style_strzCallable[[str], Attrs]<5D>style_transformationr r:rCr;)r<s"r=r><00>%_StyleStringToAttrsCache.__annotate__s(<00><00>9<>9<>!7<>9<>2<>9<>
<0E> 9r?c <09><00>WnW nR#<00>N<>r<>r<>)<03>selfr<66>r<>s&&&r=<00>__init__<5F>!_StyleStringToAttrsCache.__init__s<00><00>
(?<3F>$<24>$8<>!r?c<01> <00>V^8<>dQhRRRR/#)r&<00> style_str<74>strr:rr;)r<s"r=r>r<>s<00><00><15><15>S<EFBFBD><15>U<EFBFBD>r?c <09>f<00>VPV4pVPPV4pW V&V#r<>)r<>r<><00>transform_attrs)r<>r<><00>attrss&& r=<00> __missing__<5F>$_StyleStringToAttrsCache.__missing__s4<00><00><14>,<2C>,<2C>Y<EFBFBD>7<><05><14>)<29>)<29>9<>9<>%<25>@<40><05><1F>Y<EFBFBD><0F><14> r?r<>N<>r<>r<>r<>r<>r<>r<>r<>r<>r;r?r=r4r4s<00><00><08>
9<><15>r?r4c<01>2<00>]tRtRtRtRRltRRltRtR#) r6i$ac
Cache for remember which style strings don't render the default output
style (default fg/bg, no underline and no reverse and no blink). That way
we know that we should render these cells, even when they're empty (when
they contain a space).
Note: we don't consider bold/italic/hidden because they don't change the
output if there's no text in the cell.
c<01> <00>V^8<>dQhRRRR/#)r&<00>style_string_to_attrszdict[str, Attrs]r:rCr;)r<s"r=r><00>&_StyleStringHasStyleCache.__annotate__/s<00><00>;<3B>;<3B>.><3E>;<3B>4<EFBFBD>;r?c <09><00>WnR#r<><00>r<>)r<>r<>s&&r=r<><00>"_StyleStringHasStyleCache.__init__/s<00><00>%:<3A>"r?c<01> <00>V^8<>dQhRRRR/#)r&r<>r<>r:r1r;)r<s"r=r>r<>2s<00><00> <1A> <1A>S<EFBFBD> <1A>T<EFBFBD> r?c <09>&<00>VPV,p\VP;'g]VP;'gIVP;'g5VP
;'g!VP ;'g VP4pW0V&V#r<>)r<>r1<00>color<6F>bgcolor<6F> underline<6E>strike<6B>blink<6E>reverse)r<>r<>r<><00>
is_defaults&& r=r<><00>%_StyleStringHasStyleCache.__missing__2s<><00><00><14>*<2A>*<2A>9<EFBFBD>5<><05><19> <11>K<EFBFBD>K<EFBFBD> <1D> <1D><14>}<7D>}<7D> <1D> <1D><14><EFBFBD><EFBFBD> <1D> <1D><15>|<7C>|<7C> <1D> <1D><15>{<7B>{<7B>  <1D> <1D>
<15>}<7D>}<7D> 
<EFBFBD>
<EFBFBD>%<25>Y<EFBFBD><0F><19>r?r<>Nr<4E>r;r?r=r6r6$s<00><00><08>;<3B> <1A> r?r6c<01>&<00>]tRtRtRtRtRtRtRtR#)<08> CPR_SupportiAz&Enum: whether or not CPR is supported.<2E> SUPPORTED<45> NOT_SUPPORTED<45>UNKNOWNr;N) r<>r<>r<>r<>r<>r<>r<>r<>r<>r;r?r=r<>r<>As<00><00>,<2C><1B>I<EFBFBD>#<23>M<EFBFBD><17>Gr?r<>c<01><><00>]tRtRtRt^tRRRlltRRRllt]RR l4t ]R
R l4t
]R R l4t RRlt RRlt ]RRl4tRRRlltR RRlltR!RRlltRRltRtR#)"r#iIz<>
Typical usage:
::
output = Vt100_Output.from_pty(sys.stdout)
r = Renderer(style, output)
r.render(app, layout=...)
Nc <01>0<00>V^8<>dQhRRRRRRRRR R
R R /#) r&r]rr)rr2r1<00> mouse_supportr<00>cpr_not_supported_callbackzCallable[[], None] | Noner:rCr;)r<s"r=r><00>Renderer.__annotate__VsF<00><00>&!<21>&!<21><18>&!<21><17>&!<21><1A> &!<21>
$<24> &!<21> %><3E> &!<21>
<0E>&!r?c <09><><00>WnW nW0n\V4VnWPnRVnRVnRVnRVn \4Vn \PVnVP'g\P VnRVnRVnRVnRVnRVnVP-RR7R#)FNT)<01>_scroll)r]r)r2rr<>r<><00>_in_alternate_screen<65>_mouse_support_enabled<65>_bracketed_paste_enabled<65>_cursor_key_mode_resetr<00>_waiting_for_cpr_futuresr<73>r<><00> cpr_support<72>responds_to_cprr<72><00>_attrs_for_style<6C>_style_string_has_style<6C>_last_style_hash<73>_last_transformation_hash<73>_last_color_depth<74>reset)r<>r]r)r2r<>r<>s&&&&&&r=r<><00>Renderer.__init__Vs<><00><00><1B>
<EFBFBD><1C> <0B>&<26><18>&<26>}<7D>5<><04><1A>*D<>'<27>%*<2A><04>!<21>&+<2B><04>#<23>(-<2D><04>%<25>&+<2B><04>#<23>>C<01>W<EFBFBD><04>%<25>&<26>.<2E>.<2E><04><18><15>%<25>%<25>%<25>*<2A>8<>8<>D<EFBFBD> <1C>BF<01><04><1D>IM<49><04>$<24>15<31><04><1D>:><3E><04>&<26>48<34><04><1E> <0C>
<EFBFBD>
<EFBFBD>4<EFBFBD>
<EFBFBD> r?c<01>$<00>V^8<>dQhRRRRRR/#)r&r<>r1<00>leave_alternate_screenr:rCr;)r<s"r=r>r<>~s"<00><00>/<1C>/<1C>T<EFBFBD>/<1C>4<EFBFBD>/<1C>SW<53>/r?c <09><><00>\^^R7VnRVnRVnRVnRVn\ 4Vn^VnV'dVPP4VP'd*V'd"VPP4RVn VP'd"VPP4RVn VP'd"VPP!4RVnVPP#4VPP%4VPP'4R#)<04>rNNF)r<00> _cursor_pos<6F> _last_screen<65>
_last_size<EFBFBD> _last_style<6C>_last_cursor_shaper<00>mouse_handlers<72>_min_available_heightr)<00>scroll_buffer_to_promptr<74><00>quit_alternate_screenr<6E><00>disable_mouse_supportr<74><00>disable_bracketed_paste<74>reset_cursor_shaper<65><00>flush)r<>r<>r<>s&&&r=r<><00>Renderer.reset~s<00><00> <20>1<EFBFBD><01>?<3F><04><18> ,0<><04><19>'+<2B><04><0F>'+<2B><04><18>6:<3A><04><1F>,<2C>o<EFBFBD><04><1B>&'<27><04>"<22>
<13> <10>K<EFBFBD>K<EFBFBD> /<2F> /<2F> 1<> <10> $<24> $<24> $<24>)?<3F> <10>K<EFBFBD>K<EFBFBD> -<2D> -<2D> /<2F>(-<2D>D<EFBFBD> %<25> <10> &<26> &<26> &<26> <10>K<EFBFBD>K<EFBFBD> -<2D> -<2D> /<2F>*/<2F>D<EFBFBD> '<27> <10> (<28> (<28> (<28> <10>K<EFBFBD>K<EFBFBD> /<2F> /<2F> 1<>,1<>D<EFBFBD> )<29> <0C> <0B> <0B>&<26>&<26>(<28> <0C> <0B> <0B><1F><1F>!<21>
<0A> <0B> <0B><19><19>r?c<01><00>V^8<>dQhRR/#)r&r:r.r;)r<s"r=r>r<><00>s<00><00>!<21>!<21>m<EFBFBD>!r?c <0A><00>VP#)zV
The `Screen` class that was generated during the last rendering.
This can be `None`.
)r<><00>r<>s&r=<00>last_rendered_screen<65>Renderer.last_rendered_screen<65>s<00><00> <14> <20> <20> r?c<01><00>V^8<>dQhRR/#<00>r&r:r1r;)r<s"r=r>r<><00>s<00><00> <19> <19><14> r?c <0A><><00>VP'gVP^8<>dR#VPP4VnR# \dR#i;i)z<>
True when the height from the cursor until the bottom of the terminal
is known. (It's often nicer to draw bottom toolbars only if the height
is known, in order to avoid flickering when the CPR response arrives.)
TF)r2r<>r)<00>get_rows_below_cursor_position<6F>NotImplementedErrorr<72>s&r=<00>height_is_known<77>Renderer.height_is_known<77>sO<00><00> <10> <1B> <1B> <1B>t<EFBFBD>9<>9<>A<EFBFBD>=<3D><17> <19>)-<2D><1B><1B>)S<>)S<>)U<>D<EFBFBD> &<26><17><>"<22> <19><18> <19>s<00>A<00> A<03>Ac<01><00>V^8<>dQhRR/#)r&r:r9r;)r<s"r=r>r<><00>s<00><00> H<01> H<01>3<EFBFBD> Hr?c <0A>8<00>VP'd^#VP^8<>dlVPP4PpVP
'dVP
P M^pV\VPV4,
#\R4h)zE
Return the number of rows visible in the terminal above the layout.
zRows above layout is unknown.) r<>r<>r)<00>get_sizersr<>r}rnr<>)r<><00>
total_rows<EFBFBD>last_screen_heights& r=<00>rows_above_layout<75>Renderer.rows_above_layout<75>s~<00><00>
<10> $<24> $<24> $<24><14> <11> '<27> '<27>!<21> +<2B><1D><1B><1B>-<2D>-<2D>/<2F>4<>4<>J<EFBFBD>=A<>=N<>=N<>=N<><14>!2<>!2<>!9<>!9<>TU<54> <1E><1D><03>D<EFBFBD>$><3E>$><3E>@R<> S<>S<> S<>&<26>'F<>G<> Gr?c<01><00>V^8<>dQhRR/#rBr;)r<s"r=r>r<><00>s<00><00>;2<>;2<>$<24>;2r?c <0A>Ja<00>SPP^8XgQhSP'd,SPP 4P
SnR#SPP4SnR# \dMi;iSP\P8XdR#RT3RllpSP\P8Xd
T!4R#SP'dR#T!4RT3Rllp\4PT!44R#)a
Get current cursor position.
We do this to calculate the minimum available height that we can
consume for rendering the prompt. This is the available space below te
cursor.
For vt100: Do CPR request. (answer will arrive later.)
For win32: Do API call. (Answer comes immediately.)
Nc<01><00>V^8<>dQhRR/#rBr;)r<s"r=r><00>?Renderer.request_absolute_cursor_position.<locals>.__annotate__<5F>s<00><00> &<26> &<26><04> &r?c<01><><<01>SPP\44SPP 4R#r<>)r<><00>appendrr)<00> ask_for_cprr<72>s<00>r=<00>do_cpr<70>9Renderer.request_absolute_cursor_position.<locals>.do_cpr<70>s)<00><><00> <10> )<29> )<29> 0<> 0<><16><18> :<3A> <10>K<EFBFBD>K<EFBFBD> #<23> #<23> %r?c<01><00>V^8<>dQhRR/#rBr;)r<s"r=r>rs<00><00> 6<> 6<>T<EFBFBD> 6r?c<00><01><"<00>\SP4GRjx<01>L
SP\P8Xd<\P
SnSP 'dSP 4R#R#R#L`5ir<>)r<00> CPR_TIMEOUTr<54>r<>r<>r<>r<>r<>s<00>r=<00>timer<65>8Renderer.request_absolute_cursor_position.<locals>.timerse<00><><00><00><17><04>(<28>(<28>)<29> )<29> )<29><14><1F><1F>;<3B>#6<>#6<>6<>#.<2E>#<<3C>#<<3C><04> <20><17>2<>2<>2<><18>3<>3<>5<>3<>7<> *<2A>s<00>A?<01>A=<04>A A?<01>'A?)r<>rPr2r)r<>rsr<>r<>r<>r<>r<>r<>r<><00>waiting_for_cprr<00>create_background_task)r<>rr sf r=<00> request_absolute_cursor_position<6F>)Renderer.request_absolute_cursor_position<6F>s<><00><><00><14><1F><1F>!<21>!<21>Q<EFBFBD>&<26>&<26>&<26> <10> <1B> <1B> <1B>)-<2D><1B><1B>)=<3D>)=<3D>)?<3F>)D<>)D<>D<EFBFBD> &<26> <12> <11>)-<2D><1B><1B>)S<>)S<>)U<>D<EFBFBD> &<26> <12><>"<22> <11> <10> <11><> <10> <1B> <1B>{<7B>8<>8<> 8<> <12> &<26> &<26>
<10> <1B> <1B>{<7B>4<>4<> 4<> <12>H<EFBFBD> <12> <10> <1F> <1F> <1F> <12><0E><08> 6<> 6<> <10> <09>(<28>(<28><15><17>1s<00>A><00>> B <03> B c<01> <00>V^8<>dQhRRRR/#)r&rcr9r:rCr;)r<s"r=r>r<>s<00><00><1F><1F>c<EFBFBD><1F>d<EFBFBD>r?c <0A><00>\PVnVPP 4P
pW!,
^,pW0nVPP4pVPR4R# \dR#i;i)zq
To be called when we know the absolute cursor position.
(As an answer of a "Cursor Position Request" response.)
N) r<>r<>r<>r)r<>rsr<>r<><00>popleft<66>
set_result<EFBFBD>
IndexError)r<>rcr<><00>rows_below_cursor<6F>fs&& r=<00>report_absolute_cursor_row<6F>#Renderer.report_absolute_cursor_rows}<00><00>
'<27>0<>0<><04><18><1A>[<5B>[<5B>)<29>)<29>+<2B>0<>0<>
<EFBFBD>&<26>,<2C>q<EFBFBD>0<><19>&7<>"<22> <1F><14>-<2D>-<2D>5<>5<>7<>A<EFBFBD> <0E>L<EFBFBD>L<EFBFBD><14> <1E><><1A> <11> <10> <11>s<00>A=<00>= B <03> B c<01><00>V^8<>dQhRR/#r<>r;)r<s"r=r>r<>)s<00><00>3<>3<><14>3r?c <0A>,<00>\VP4#)zQ
Waiting for CPR flag. True when we send the request, but didn't got a
response.
)r1r<>r<>s&r=r <00>Renderer.waiting_for_cpr(s<00><00> <14>D<EFBFBD>1<>1<>2<>2r?c<01> <00>V^8<>dQhRRRR/#)r&<00>timeoutr9r:rCr;)r<s"r=r>r<>0s<00><00><1A><1A>C<EFBFBD><1A><04>r?c<00> <0A>daaa"<00>\SP4oS'd SP\P8XdR#RV3RllpRVVV3Rllp\ V!44\ V!440p\ V\R7GRjx<01>L
wrVVFpVP4K R#L!5i)z
Wait for a CPR response.
Nc<01><00>V^8<>dQhRR/#rBr;)r<s"r=r><00>5Renderer.wait_for_cpr_responses.<locals>.__annotate__:s<00><00> !<21> !<21>$<24> !r?c<00><01>:<"<00>SF pVGRjx<01>L
K R#L
5ir<>r;)<02>
response_f<EFBFBD> cpr_futuress <20>r=<00>wait_for_responses<65>;Renderer.wait_for_cpr_responses.<locals>.wait_for_responses:s<00><><00><00>)<29>
<EFBFBD> <20> <20> <20>*<2A> <20>s <00> <01><06> c<01><00>V^8<>dQhRR/#rBr;)r<s"r=r>r!>s<00><00> 4<> 4<><04> 4r?c<00><01><><"<00>\S4GRjx<01>L
SFpVP4K \4SnR#L.5ir<>)r<00>cancelrr<>)r#r$r<>rs <20><><EFBFBD>r=<00>wait_for_timeout<75>9Renderer.wait_for_cpr_responses.<locals>.wait_for_timeout>s:<00><><00><00><17><07>.<2E> <20> <20>*<2A>
<EFBFBD><1A>!<21>!<21>#<23>*<2A>,1<>G<EFBFBD>D<EFBFBD> )<29> !<21>s<00>A<01>A<04>/A)<01> return_when) <09>listr<74>r<>r<>r<>rrrr)) r<>rr%r*<00>tasks<6B>_<>pending<6E>taskr$s ff @r=<00>wait_for_cpr_responses<65>Renderer.wait_for_cpr_responses0s<><00><><00><00><1B>4<EFBFBD>8<>8<>9<> <0B><1B>d<EFBFBD>.<2E>.<2E>+<2B>2K<32>2K<32>K<><17> !<21> !<21> 4<> 4<> <1A>,<2C>.<2E> /<2F> <19>*<2A>,<2C> -<2D>
<EFBFBD><05> <20><05>?<3F>C<>C<>
<EFBFBD><01><1B>D<EFBFBD> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD><1C>D<01>s<00>BB0<01> B.<04> "B0c<01>(<00>V^8<>dQhRRRRRRRR/#) r&r'r(r<>r"r0r1r:rCr;)r<s"r=r>r<>Ns2<00><00>N<19>N<19>#<23>N<19>-3<>N<19>>B<>N<19> <0A>Nr?c <0A>x
<00>VPpVP'd*VP'gRVnVP4VP'g"VPP 4RVnVP 'g"VPP4RVnVP4pV'd+VP'gVP4RVn M1V'g*VP'dVP4RVn VP4p\4pRVn\4pVP'dVP p M<>V'd<VP"P%VP&VP 4P(p MyVP*'dVP*P,M^p
\/VP0V
VP"P%VP&VP 4P(4p \3W<>P 4p VP4V8wdRVnVP6P94VP:8wgEVP<P94VP>8wgVP@VPB8wdRVnRVn"RVn#VPDf0\IVP6PJVP<4Vn"VPFf\MVPD4Vn#VP6P94VnVP<P94VnVP@Vn!VP"POVV\Q^^VP&V R7RRRR7VPS4VPT'dVPWVPT4\YTTTVPZVP@VP*VP\TVPVPDVPFTVP4'dVP4P&M^R7 wVn-Vn.WpnW`nW<>n/VP`PcV4p VPdeVPdV 8wdVPgV 4W<>n2VPi4VPjVPln5V'dVPo4R#R#)z<>
Render the current interface to the output.
:param is_done: When True, put the cursor at the end of the interface. We
won't print any changes to this part.
TFN)<04>xpos<6F>yposrVr}<00>)<03> parent_style<6C>erase_bg<62>z_index)r2r3r5r7r8)8r)r2r<><00>enter_alternate_screenr<6E><00>enable_bracketed_paster<65><00>reset_cursor_key_moder<65>r<><00>enable_mouse_supportr<74>r<>rr<>rrs<00> container<65>preferred_heightrr<00> preferredr<64>r}rnr<>r|r<>r]<00>invalidation_hashr<68>r<>r<>r,r<>r<>r<>r4r<>r6<00>write_to_screenr<00>draw_all_floats<74>
exit_style<EFBFBD>append_style_to_contentr<74>r<>r<>r<><00>cursor<6F>get_cursor_shaper<65><00>set_cursor_shaper<65><00>visible_windowsr<73>r<>) r<>r'r<>r0r)<00>needs_mouse_supportr7r*r<>r}<00> last_height<68>new_cursor_shapes &&&& r=<00>render<65>Renderer.renderNs!<00><00><16><1B><1B><06> <10> <1B> <1B> <1B>D<EFBFBD>$=<3D>$=<3D>$=<3D>(,<2C>D<EFBFBD> %<25> <12> )<29> )<29> +<2B><14>,<2C>,<2C>,<2C> <10>K<EFBFBD>K<EFBFBD> .<2E> .<2E> 0<>,0<>D<EFBFBD> )<29><14>*<2A>*<2A>*<2A> <10>K<EFBFBD>K<EFBFBD> -<2D> -<2D> /<2F>*.<2E>D<EFBFBD> '<27>#<23>0<>0<>2<><1B> <1E>t<EFBFBD>'B<>'B<>'B<> <12> '<27> '<27> )<29>*.<2E>D<EFBFBD> '<27>$<24><14>)D<>)D<>)D<> <12> (<28> (<28> *<2A>*/<2F>D<EFBFBD> '<27><16><EFBFBD><EFBFBD> <20><04><17><18><06>"<22><06><1A>&<26><1F><0E> <10> <1B> <1B> <1B><19>Y<EFBFBD>Y<EFBFBD>F<EFBFBD> <14><1B>%<25>%<25>6<>6<><14> <0C> <0C>d<EFBFBD>i<EFBFBD>i<EFBFBD><0E><17>i<EFBFBD> <13>7;<3B>6G<36>6G<36>6G<36>$<24>+<2B>+<2B>2<>2<>Q<EFBFBD>K<EFBFBD><18><14>*<2A>*<2A><1B><16> <20> <20>1<>1<>$<24>,<2C>,<2C><04> <09> <09>J<>T<>T<><0E>F<EFBFBD> <15>V<EFBFBD>Y<EFBFBD>Y<EFBFBD>'<27><06> <10>?<3F>?<3F>d<EFBFBD> "<22> $<24>D<EFBFBD> <1D> <11>J<EFBFBD>J<EFBFBD> (<28> (<28> *<2A>d<EFBFBD>.C<>.C<> C<><12>'<27>'<27>9<>9<>;<3B><13>-<2D>-<2D>.<2E><12><EFBFBD><EFBFBD>$<24>"8<>"8<>8<> $<24>D<EFBFBD> <1D>$(<28>D<EFBFBD> !<21>+/<2F>D<EFBFBD> (<28> <0F> <20> <20> (<28>$<<3C><14>
<EFBFBD>
<EFBFBD>2<>2<>C<EFBFBD>4L<34>4L<34>%<0E>D<EFBFBD> !<21> <10> '<27> '<27> /<2F>+D<><14>%<25>%<25>,<0E>D<EFBFBD> (<28>!%<25>
<EFBFBD>
<EFBFBD> <<3C> <<3C> ><3E><04><1D>),<2C>)A<>)A<>)S<>)S<>)U<><04>&<26>!$<24><1F><1F><04><1E><0E><18><18>(<28>(<28> <12> <1A> <19>q<EFBFBD>q<EFBFBD><04> <0C> <0C>V<EFBFBD> L<><1B><1A><18> )<29>
<EFBFBD> <0F><1E><1E> <20> <0F>><3E>><3E>><3E> <12> *<2A> *<2A>3<EFBFBD>><3E>><3E> :<3A>.A<01> <0F> <12> <12> <10> <1C> <1C> <0F>O<EFBFBD>O<EFBFBD> <10> <1D> <1D> <10> <1C> <1C> <13><1C>(<28>(<28>#'<27>#8<>#8<>#'<27>#?<3F>#?<3F><15>7;<3B><EFBFBD><EFBFBD><EFBFBD>D<EFBFBD>O<EFBFBD>O<EFBFBD>3<>3<>A<EFBFBD>.
<EFBFBD>*<2A><04><18>$<24>*<2A>#<23><19><1E><0F>,<2C><1B><1F>:<3A>:<3A>6<>6<>s<EFBFBD>;<3B><18> <10> #<23> #<23> +<2B><13>&<26>&<26>*:<3A>:<3A> <12> #<23> #<23>$4<> 5<>&6<> #<23> <0F> <0C> <0C><0E>&,<2C>%;<3B>%;<3B><03>
<EFBFBD>
<EFBFBD>"<22> <12> <10>J<EFBFBD>J<EFBFBD>L<EFBFBD> r?c<01> <00>V^8<>dQhRRRR/#)r&r<>r1r:rCr;)r<s"r=r>r<><00>s<00><00>B<01>B<01>D<EFBFBD>B<01>D<EFBFBD>Br?c <0A>V<00>VPpVPVPP4VP VPP
4VP 4VP4VP4VP4VPVR7R#)a"
Hide all output and put the cursor back at the first line. This is for
instance used for running a system command (while hiding the CLI) and
later resuming the same CLI.)
:param leave_alternate_screen: When True, and when inside an alternate
screen buffer, quit the alternate screen.
)r<>N) r)rxr<>rOrwrPr{rGr<>r<>r<>)r<>r<>r)s&& r=<00>erase<73>Renderer.erase<73>s}<00><00><16><1B><1B><06><0E><1E><1E>t<EFBFBD>/<2F>/<2F>1<>1<>2<><0E><18><18><14>)<29>)<29>+<2B>+<2B>,<2C><0E><19><19><1B><0E><1F><1F>!<21><0E><1E><1E> <20><0E> <0C> <0C><0E> <0C>
<EFBFBD>
<EFBFBD>*@<40>
<EFBFBD>Ar?c<01><00>V^8<>dQhRR/#rBr;)r<s"r=r>r<><00>s<00><00>0<>0<>t<EFBFBD>0r?c <0A><><00>VP4VPpVP4VP^^4VP 4VP 4R#)z
Clear screen and go to 0,0
N)rSr)<00> erase_screen<65> cursor_gotor<6F>r)r<>r)s& r=<00>clear<61>Renderer.clear<61>sI<00><00>
<0A>
<EFBFBD>
<EFBFBD> <0C><16><1B><1B><06><0E><1B><1B><1D><0E><1A><1A>1<EFBFBD>a<EFBFBD> <20><0E> <0C> <0C><0E> <0C>-<2D>-<2D>/r?)r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r2r<>r<>r)r])FFN)FT)<01>)F)T)r<>r<>r<>r<>r<>r
r<>r<><00>propertyr<79>r<>r<>rrr r2rOrSrYr<>r;r?r=r#r#Is<><00><00><08><14>K<EFBFBD>&!<21>P/<1C>b<0E>!<21><0E>!<21><0E> <19><0E> <19><0E> H<01><0E> H<01>;2<>z<1F>.<0E>3<><0E>3<><1A><N<19>`B<01>*0<>0r?Nc <01>0<00>V^8<>dQhRRRRRRRRR R
R R /#) r&r)r<00>formatted_textrr]rr<>zStyleTransformation | Noner,zColorDepth | Noner:rCr;)r<s"r=r>r>sD<00><00>0<13>0<13> <12>0<13>$<24>0<13> <15>0<13>5<> 0<13>
#<23> 0<13> 
<EFBFBD> 0r?c<05>P<00>\V4pT;'g \4pT;'gVP4pVP4VP 4Rp\ VP V4pVF<>vr<>p
Wx,p W<>8wd+V 'dVPW<>4MVP4T pRV9dVPV 4KYV PRR4p V PRR4p VPV 4K<> VP4VP4R#)zL
Print a list of (style_str, text) tuples in the given style to the output.
Nz[ZeroWidthEscape]rMr8<00>
rL) rr<00>get_default_color_depthrGr<>r4r<>rurt<00>replacerWr<>) r)r^r]r<>r,<00> fragments<74>
last_attrsr3r<><00>textr/r<>s &&&&& r=r$r$s<00><00>"<22>.<2E>1<>I<EFBFBD>/<2F>M<>M<>3K<33>3M<33><18><1D>A<>A<><16>!?<3F>!?<3F>!A<>K<EFBFBD> <0B><1B><1B><1D>
<EFBFBD><1A><1A><1C>#<23>J<EFBFBD>6<> <0A>%<25>%<25>';<3B><06><1A> )<29><1B> <09>!<21>&<26>1<><05> <11> <1E><14><16>%<25>%<25>e<EFBFBD>9<><16>'<27>'<27>)<29><1A>
<EFBFBD> <1F>)<29> +<2B> <12> <1C> <1C>T<EFBFBD> "<22><18><<3C><<3C><04>b<EFBFBD>)<29>D<EFBFBD><18><<3C><<3C><04>f<EFBFBD>-<2D>D<EFBFBD> <12>L<EFBFBD>L<EFBFBD><14> <1E>) )<29>. <0B><1B><1B><1D>
<EFBFBD>L<EFBFBD>L<EFBFBD>Nr?)NN)=r<><00>
__future__r<00>asynciorrrrr<00> collectionsr<00>enumr <00>typingr
r r r r<00>"prompt_toolkit.application.currentr<00>prompt_toolkit.cursor_shapesr<00>prompt_toolkit.data_structuresrr<00>prompt_toolkit.filtersrr<00>prompt_toolkit.formatted_textrr<00>$prompt_toolkit.layout.mouse_handlersr<00>prompt_toolkit.layout.screenrrr<00>prompt_toolkit.outputrr<00>prompt_toolkit.stylesrrrr <00>prompt_toolkit.applicationr!<00>prompt_toolkit.layout.layoutr"<00>__all__r<5F><00> Exceptionr<6E>r<>r4r1r6r<>r#r$r;r?r=<00><module>rxs<><00><01><04>
#<23>G<>G<><1D><15>?<3F>?<3F>6<>4<>6<>:<3A>M<>><3E>D<>D<>4<><02><02><11>6<>3<><0F><1A> <02><07> `#<23>FE<01>9<EFBFBD>E<01><15>t<EFBFBD>C<EFBFBD><15>J<EFBFBD>/<2F><15>,<1A><04>S<EFBFBD>$<24>Y<EFBFBD><0F><1A>:<18>$<24><18>x0<>x0<>v 0<13>0r?