Files
ServerSync/lib/prompt_toolkit/layout/__pycache__/margins.cpython-314.pyc

102 lines
14 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<EFBFBD>(<00><01><00>Rt^RIHt^RIHtHt^RIHtHt^RI H
t
H t ^RI H t HtHt^RIHt^RIHt]'d^RIHt.ROt!RR ]R7t!RR
]4t!RR ]4t!RR ]4t!RR ]4tR#)zQ
Margin implementations for a :class:`~prompt_toolkit.layout.containers.Window`.
)<01> annotations)<02>ABCMeta<74>abstractmethod)<02> TYPE_CHECKING<4E>Callable)<02> FilterOrBool<6F> to_filter)<03>StyleAndTextTuples<65>fragment_list_to_text<78>to_formatted_text)<01>
get_cwidth)<01> UIContent)<01>WindowRenderInfo<66>Margin<69>NumberedMargin<69>ScrollbarMargin<69>ConditionalMargin<69> PromptMarginc<01>F<00>]tRt^ tRt]RRl4t]RRl4tRtR#)rz
Base interface for a margin.
c<01> <00>V^8<>dQhRRRR/#<00><05><00>get_ui_contentzCallable[[], UIContent]<5D>return<72>int<6E>)<01>formats"<22>D/tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/layout/margins.py<70> __annotate__<5F>Margin.__annotate__&s<00><00><11><11>(?<3F><11>C<EFBFBD><11>c <0A><00>^#)z<>
Return the width that this margin is going to consume.
:param get_ui_content: Callable that asks the user control to create
a :class:`.UIContent` instance. This can be used for instance to
obtain the number of lines.
r<00><02>selfrs&&r<00> get_width<74>Margin.get_width%s<00><00>r c<01>(<00>V^8<>dQhRRRRRRRR/#<00>r<00>window_render_infor<00>widthr<00>heightrr r)rs"rrr1s,<00><00><12><12>"2<><12>;><3E><12>HK<48><12> <1B>r c <0A><00>.#)aS
Creates a margin.
This should return a list of (style_str, text) tuples.
:param window_render_info:
:class:`~prompt_toolkit.layout.containers.WindowRenderInfo`
instance, generated after rendering and copying the visible part of
the :class:`~prompt_toolkit.layout.controls.UIControl` into the
:class:`~prompt_toolkit.layout.containers.Window`.
:param width: The width that's available for this margin. (As reported
by :meth:`.get_width`.)
:param height: The height that's available for this margin. (The height
of the :class:`~prompt_toolkit.layout.containers.Window`.)
r<00>r#r(r)r*s&&&&r<00> create_margin<69>Margin.create_margin0s <00><00>$<12> r rN) <09>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__rr$r-<00>__static_attributes__rr rrr s/<00><00><08><14><11><14><11><14><12><14>r )<01> metaclassc<01>B<00>]tRt^EtRtR
RRlltRRltRRltRtR #) rz<>
Margin that displays the line numbers.
:param relative: Number relative to the cursor position. Similar to the Vi
'relativenumber' option.
:param display_tildes: Display tildes after the end of the document, just
like Vi does.
c<01>$<00>V^8<>dQhRRRRRR/#)r<00>relativer<00>display_tildesr<00>Noner)rs"rr<00>NumberedMargin.__annotate__Os$<00><00>8<>8<>$<24>8<>>J<>8<> <0A>8r c <09>F<00>\V4Vn\V4VnR#<00>N)rr8r9)r#r8r9s&&&r<00>__init__<5F>NumberedMargin.__init__Os<00><00>"<22>(<28>+<2B><04> <0A>'<27><0E>7<><04>r c<01> <00>V^8<>dQhRRRR/#rr)rs"rrr;Us<00><00>0<>0<>(?<3F>0<>C<EFBFBD>0r c <09>^<00>V!4Pp\^\V 4^,4#)<01>)<03>
line_count<EFBFBD>max<61>len)r#rrCs&& rr$<00>NumberedMargin.get_widthUs)<00><00>#<23>%<25>0<>0<>
<EFBFBD><12>1<EFBFBD>c<EFBFBD>Z<EFBFBD>L<EFBFBD>*<2A>Q<EFBFBD>.<2E>/<2F>/r c<01>(<00>V^8<>dQhRRRRRRRR/#r'r)rs"rrr;Ys,<00><00>-<16>-<16>"2<>-<16>;><3E>-<16>HK<48>-<16> <1B>-r c <09><><00>VP4pRpRpVPPPp.pRp \ VP
4F<>wr<>W<EFBFBD>8wd<>V fM<>W<EFBFBD>8Xd\V'd#VP VRV ^,,34M<>VP VRV ^,,PV434MPV'd\W<>,
4^,
p VP VRV ^,,PV434T p VP R4K<> VP4'd.X
VP8dVP R4V
^, p
K-V#)zclass:line-numberzclass:line-number.currentNz%iz%i <20><02><00>
)z class:tildez~
) r8<00>
ui_content<EFBFBD>cursor_position<6F>y<> enumerate<74>displayed_lines<65>append<6E>rjust<73>absr9<00> window_height) r#r(r)r*r8<00>style<6C> style_current<6E>current_lineno<6E>result<6C> last_linenorN<00>linenos &&&& rr-<00>NumberedMargin.create_marginYs8<00><00><18>=<3D>=<3D>?<3F><08>#<23><05>3<> <0A>,<2C>6<>6<>F<>F<>H<>H<><0E>&(<28><06><1A> <0B>"<22>#5<>#E<>#E<>F<>I<EFBFBD>A<EFBFBD><15>$<24><19>><3E><18><1B>-<2D><1F><1E> <0A> <0A>}<7D>d<EFBFBD>f<EFBFBD>q<EFBFBD>j<EFBFBD>6I<36>&J<>K<><1E> <0A> <0A>*<2A>U<EFBFBD>f<EFBFBD>q<EFBFBD>j<EFBFBD>-A<>,H<>,H<><15>,O<>P<><1A>
 <20>!$<24>V<EFBFBD>%<<3C>!=<3D><01>!A<><06><1A>M<EFBFBD>M<EFBFBD>5<EFBFBD>5<EFBFBD>F<EFBFBD>Q<EFBFBD>J<EFBFBD>+?<3F>*F<>*F<>u<EFBFBD>*M<>"N<>O<> <20>K<EFBFBD> <12>M<EFBFBD>M<EFBFBD>*<2A> %<25>-G<01>2 <10> <1E> <1E> <20> <20><13>(<28>6<>6<>6<><16> <0A> <0A>4<>5<><11>Q<EFBFBD><06><01><15> r )r9r8N)FF<46> r/r0r1r2r3r>r$r-r4rr rrrEs<00><00><08>8<> 0<>-<16>-r c<01>><00>]tRt^<5E>tRtRRltRRltRRltRtR #)
rzB
Wrapper around other :class:`.Margin` classes to show/hide them.
c<01>$<00>V^8<>dQhRRRRRR/#)r<00>marginr<00>filterrrr:r)rs"rr<00>ConditionalMargin.__annotate__<5F>s!<00><00>(<28>(<28>v<EFBFBD>(<28>|<7C>(<28><04>(r c <09>2<00>Wn\V4VnR#r=)r_rr`)r#r_r`s&&&rr><00>ConditionalMargin.__init__<5F>s<00><00><1C> <0B><1F><06>'<27><04> r c<01> <00>V^8<>dQhRRRR/#rr)rs"rrra<00>s<00><00><15><15>(?<3F><15>C<EFBFBD>r c <09>h<00>VP4'dVPPV4#^#)<01>)r`r_r$r"s&&rr$<00>ConditionalMargin.get_width<74>s%<00><00> <0F>;<3B>;<3B>=<3D>=<3D><17>;<3B>;<3B>(<28>(<28><1E>8<> 8<>r c<01>(<00>V^8<>dQhRRRRRRRR/#r'r)rs"rrra<00>s,<00><00><16><16>"2<><16>;><3E><16>HK<48><16> <1B>r c <09>z<00>V'd3VP4'dVPPWV4#.#r=)r`r_r-r,s&&&&rr-<00>ConditionalMargin.create_margin<69>s.<00><00> <11>T<EFBFBD>[<5B>[<5B>]<5D>]<5D><17>;<3B>;<3B>,<2C>,<2C>-?<3F><06>O<> O<><15>Ir )r`r_Nr\rr rrr<00>s<00><00><08>(<28><15> <16>r c<01>B<00>]tRt^<5E>tRtR
RRlltRRltRRltRtR #) rzW
Margin displaying a scrollbar.
:param display_arrows: Display scroll up/down arrows.
c<01>(<00>V^8<>dQhRRRRRRRR/#)r<00>display_arrowsr<00>up_arrow_symbol<6F>str<74>down_arrow_symbolrr:r)rs"rr<00>ScrollbarMargin.__annotate__<5F>s2<00><00>3<>3<>$<24>3<><1D>3<><1F> 3<>
<0E> 3r c <09>><00>\V4VnW nW0nR#r=)rrmrnrp)r#rmrnrps&&&&rr><00>ScrollbarMargin.__init__<5F>s<00><00> (<28><0E>7<><04><1B>.<2E><1C>!2<>r c<01> <00>V^8<>dQhRRRR/#rr)rs"rrrq<00>s<00><00><11><11>(?<3F><11>C<EFBFBD>r c <09><00>^#)<01>rr"s&&rr$<00>ScrollbarMargin.get_width<74>s<00><00>r c<01>(<00>V^8<>dQhRRRRRRRR/#r'r)rs"rrrq<00>s,<00><00>?<1A>?<1A>"2<>?<1A>;><3E>?<1A>HK<48>?<1A> <1B>?r c
 <09><>aa<11>VPpVPpVP4pV'd
V^,p\VP4\ V4, pVP \ V4, p\\V\^WW,444o\WX,4oRVV3Rllp .p
V'd V
PRVP3R .4Rp Rp Rp Rp\V4F<>pV !V4'd>V !V^,4'gV
PVR34MPV
PV R34M<V !V^,4'dV
PV R34MV
PV R34V
PR
4K<> V'dV
PRVP34V
# \d.u#i;i) rc<01> <00>V^8<>dQhRRRR/#)r<00>rowrr<00>boolr)rs"rr<00>3ScrollbarMargin.create_margin.<locals>.__annotate__<5F>s<00><00> P<01> P<01>c<EFBFBD> P<01>d<EFBFBD> Pr c<05>><<02>STu;8*;'d SS,8*#u#)z/True if we should display a button on this row.r)r{<00>scrollbar_height<68> scrollbar_tops&<26><>r<00>is_scroll_button<6F>7ScrollbarMargin.create_margin.<locals>.is_scroll_button<6F>s"<00><><00>$<24><03>O<>O<>}<7D>?O<>/O<>O<>O<>O<>Or zclass:scrollbar.arrowzclass:scrollbar.backgroundz*class:scrollbar.background,scrollbar.startzclass:scrollbar.buttonz$class:scrollbar.button,scrollbar.end<6E> )zclass:scrollbarrKrI)<10>content_heightrTrmrErP<00>float<61>vertical_scrollr<00>minrD<00>extendrn<00>rangerQrp<00>ZeroDivisionError)r#r(r)r*r<>rTrm<00>fraction_visible<6C>fraction_abover<65>rX<00>scrollbar_background<6E>scrollbar_background_start<72>scrollbar_button<6F>scrollbar_button_end<6E>irr<>s&&&& @@rr-<00>ScrollbarMargin.create_margin<69>s<><00><><00>,<2C>:<3A>:<3A><0E>*<2A>8<>8<> <0A><1D>,<2C>,<2C>.<2E><0E> <19> <19>Q<EFBFBD> <1E>M<EFBFBD>5 <1A>"<22>#5<>#E<>#E<>F<><15><1E>J<0E> <0E> <1C>0<>?<3F>?<3F>%<25><0E>BW<42>W<>N<EFBFBD>"<22><13>M<EFBFBD>3<EFBFBD>q<EFBFBD>-<2D>*J<>#K<>L<> <0E> <1C> <20> <0A> ><3E>?<3F>M<EFBFBD>
 P<01> P<01>
*,<2C>F<EFBFBD><1D><16> <0A> <0A>0<>$<24>2F<32>2F<32>G<>1<><16><12>$@<01> <20>)U<> &<26>7<> <1C>#I<> <20><1A>=<3D>)<29><01>#<23>A<EFBFBD>&<26>&<26>+<2B>A<EFBFBD><01>E<EFBFBD>2<>2<><1F> <0A> <0A>';<3B>S<EFBFBD>&A<>B<><1E> <0A> <0A>'7<><13>&=<3D>><3E>'<27><01>A<EFBFBD><05>.<2E>.<2E><1E> <0A> <0A>'A<>3<EFBFBD>&G<>H<><1E> <0A> <0A>';<3B>S<EFBFBD>&A<>B<><16> <0A> <0A>j<EFBFBD>)<29>*<2A> <1E><16> <0A> <0A>6<><04>8N<38>8N<38>O<>P<><19>M<EFBFBD><4D>W!<21> <16><15>I<EFBFBD> <16>s<00>A7G<00> G<03>G)rmrprnN)F<>^<5E>vr\rr rrr<00>s<00><00><08> 3<><11>?<1A>?r c<01>B<00>]tRt^<5E>tRtR
RRlltRRltRRltR tR#) rab
[Deprecated]
Create margin that displays a prompt.
This can display one prompt at the first line, and a continuation prompt
(e.g, just dots) on all the following lines.
This `PromptMargin` implementation has been largely superseded in favor of
the `get_line_prefix` attribute of `Window`. The reason is that a margin is
always a fixed width, while `get_line_prefix` can return a variable width
prefix in front of every line, making it more powerful, especially for line
continuations.
:param get_prompt: Callable returns formatted text or a list of
`(style_str, type)` tuples to be shown as the prompt at the first line.
:param get_continuation: Callable that takes three inputs. The width (int),
line_number (int), and is_soft_wrap (bool). It should return formatted
text or a list of `(style_str, type)` tuples for the next lines of the
input.
Nc<01>$<00>V^8<>dQhRRRRRR/#)r<00>
get_promptz Callable[[], StyleAndTextTuples]<5D>get_continuationz5None | Callable[[int, int, bool], StyleAndTextTuples]rr:r)rs"rr<00>PromptMargin.__annotate__ s(<00><00>1<>1<>4<>1<>;<3B>1<>
<0E> 1r c <09><00>WnW nR#r=)r<>r<>)r#r<>r<>s&&&rr><00>PromptMargin.__init__ s<00><00> %<25><0F> 0<>r c<01> <00>V^8<>dQhRRRR/#rr)rs"rrr<>s<00><00> <20> <20>(?<3F> <20>C<EFBFBD> r c <0A>J<00>\VP44p\V4#)z Width to report to the `Window`.)r
r<>r )r#r<00>texts&& rr$<00>PromptMargin.get_widths <00><00>%<25>T<EFBFBD>_<EFBFBD>_<EFBFBD>%6<>7<><04><19>$<24><1F>r c<01>(<00>V^8<>dQhRRRRRRRR/#r'r)rs"rrr<>s,<00><00><16><16>"2<><16>;><3E><16>HK<48><16> <1B>r c  <09>&<00>VPp.pVP\VP444V'dSRpVPR,F9pVP R4VP\V!W'Wv8H444TpK; V#)N:rvNNrI)r<>r<>r r<>rPrQ)r#r(r)r*r<>rX<00>last_yrNs&&&& rr-<00>PromptMargin.create_margins<><00><00> <20>0<>0<><18>%'<27><06> <0F> <0A> <0A>'<27><04><0F><0F>(9<>:<3A>;<3B> <1C><19>F<EFBFBD>'<27>7<>7<><02>;<3B>;<3B><01><16> <0A> <0A>j<EFBFBD>)<29><16> <0A> <0A>%<25>&6<>u<EFBFBD><11><1B>&M<>N<><12><1B><06> <<3C><16> r )r<>r<>r=r\rr rrr<00>s<00><00><08>*1<> <20> <16>r N)rrrrr)r3<00>
__future__r<00>abcrr<00>typingrr<00>prompt_toolkit.filtersrr<00>prompt_toolkit.formatted_textr r
r <00>prompt_toolkit.utilsr <00>controlsr <00>
containersr<00>__all__rrrrrrr r<00><module>r<>sz<00><01><04>#<23>'<27>*<2A>:<3A><02><02>
,<2C><1F><10>,<2C> <02><07>"<12>w<EFBFBD>"<12>JA<16>V<EFBFBD>A<16>H<16><06><16>0S<1A>f<EFBFBD>S<1A>l9<16>6<EFBFBD>9r