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

126 lines
20 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<EFBFBD>6<00><01><><00>Rt^RIHt^RIHtHtHt^RIHt^RI H
t
H t H t H t Ht^RIHtHtHt.R Ot]]]]]
3,t!RR4t!R R]4tRR
R lltR #)z
Wrapper for the layout.
)<01> annotations)<03> Generator<6F>Iterable<6C>Union)<01>Buffer)<05> AnyContainer<65>ConditionalContainer<65> Container<65>Window<6F> to_container)<03> BufferControl<6F>SearchBufferControl<6F> UIControl<6F>Layout<75>InvalidLayoutErrorc<01><><00>]tRt^tRtR8RRlltRRltRRltR R
ltR R lt R Rlt
] RRl4t ] PRRl4t ] RRl4t]PRRl4t] RRl4t] RRl4tRRltRRlt] RR l4tR!R"lt] R#R$l4t] R%R&l4tR'R(ltR)R*ltR+R,ltR-R.ltR/R0ltR1R2ltR3R4ltR5R6ltR7tR#)9ra0
The layout for a prompt_toolkit
:class:`~prompt_toolkit.application.Application`.
This also keeps track of which user control is focused.
:param container: The "root" container for the layout.
:param focused_element: element to be focused initially. (Can be anything
the `focus` function accepts.)
Nc<01>$<00>V^8<>dQhRRRRRR/#)<07><00> containerr<00>focused_elementzFocusableElement | None<6E>return<72>None<6E>)<01>formats"<22>C/tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/layout/layout.py<70> __annotate__<5F>Layout.__annotate__(s(<00><00> 0<> 0<><1F> 0<>1<> 0<>
<0E> 0<>c <09>.<00>\V4Vn.Vn/Vn/VnVf5VPP \ VP444MVPV4.Vn R# \dp\R4ThRp?ii;i)Nz>Invalid layout. The layout does not contain any Window object.) r r<00>_stack<63> search_links<6B>_child_to_parent<6E>append<6E>next<78>find_all_windows<77> StopIterationr<00>focus<75>visible_windows)<04>selfrr<00>es&&& r<00>__init__<5F>Layout.__init__(s<><00><00>
&<26>i<EFBFBD>0<><04><0E>$&<26><04> <0B>GI<01><04><19>
=?<3F><04><1D> <1A> "<22> <19><14> <0B> <0B>"<22>"<22>4<EFBFBD><04>(=<3D>(=<3D>(?<3F>#@<40>A<> <11>J<EFBFBD>J<EFBFBD><EFBFBD> '<27>.0<EFBFBD><04><1C><>!<21> <19>(<28>T<><12><18><19><> <19>s<00>2A8<00>8 B<03> B<03>Bc<01><00>V^8<>dQhRR/#)rr<00>strr)rs"rrrJs<00><00>U<01>U<01>#<23>Urc <09>@<00>RVP: RVP: R2#)zLayout(z, current_window=<3D>))r<00>current_window<6F>r(s&r<00>__repr__<5F>Layout.__repr__Js%<00><00><18><14><1E><1E>*<2A>*;<3B>D<EFBFBD><O<><O<>;R<>RS<52>T<>Trc<01><00>V^8<>dQhRR/#)rrzGenerator[Window, None, None]r)rs"rrrMs<00><00><1B><1B>"?<3F>rc# <0A>t"<00>VP4Fp\V\4'gKVx<00>K! R#5i)z:
Find all the :class:`.UIControl` objects in this layout.
N)<03>walk<6C>
isinstancer
)r(<00>items& rr$<00>Layout.find_all_windowsMs)<00><00><00><19>I<EFBFBD>I<EFBFBD>K<EFBFBD>D<EFBFBD><19>$<24><06>'<27>'<27><1A>
<EFBFBD> <20>s<00>'8<01>
8c<01><00>V^8<>dQhRR/#)rrzIterable[UIControl]r)rs"rrrUs<00><00>$<24>$<24>#6<>$rc# <09>X"<00>VP4FpVPx<00>K R#5i<01>N)r$<00>content<6E>r(rs& r<00>find_all_controls<6C>Layout.find_all_controlsUs$<00><00><00><1D>.<2E>.<2E>0<>I<EFBFBD><1B>#<23>#<23> #<23>1<>s<00>(*c<01> <00>V^8<>dQhRRRR/#)r<00>value<75>FocusableElementrrr)rs"rrrYs<00><00>L<12>L<12>+<2B>L<12><04>Lrc <0A><><00>\V\4'doVP4FJp\V\4'gKVPP
V8XgK8VP V4R# \RV: R24h\V\4'deVP4F@p\V\4'gKVPV8XgK.VP V4R# \RV: R24h\V\4'dIWP49d \R4hVP4'g \R4hWn R#\V4p\V\4'd,WP49d\RV: 24hWnR#.p\!VRR7FNp\V\4'gKVP"P4'gK=VP%V4KP \'VP(4FpWS9gK WPnR# V'dV^,VnR#\R V: 24h)
a`
Focus the given UI element.
`value` can be either:
- a :class:`.UIControl`
- a :class:`.Buffer` instance or the name of a :class:`.Buffer`
- a :class:`.Window`
- Any container object. In this case we will focus the :class:`.Window`
from this container that was focused most recent, or the very first
focusable :class:`.Window` of the container.
Nz,Couldn't find Buffer in the current layout: <20>.z7Invalid value. Container does not appear in the layout.z*Invalid value. UIControl is not focusable.z5Invalid value. Window does not appear in the layout: T<><01> skip_hiddenz,Invalid value. Container cannot be focused: )r7r-r?r <00>buffer<65>namer&<00>
ValueErrorrr<00> is_focusable<6C>current_controlr r
r$r0r6r=r"<00>reversedr)r(rB<00>control<6F>windows<77>c<>ws&& rr&<00> Layout.focusYs<><00><00> <16>e<EFBFBD>S<EFBFBD> !<21> !<21><1F>1<>1<>3<><07><1D>g<EFBFBD>}<7D>5<>5<>'<27>.<2E>.<2E>:M<>:M<>QV<51>:V<><18>J<EFBFBD>J<EFBFBD>w<EFBFBD>'<27><1A>4<><1D>K<>E<EFBFBD>9<EFBFBD>TU<54>V<>W<> W<><18><05>v<EFBFBD> &<26> &<26><1F>1<>1<>3<><07><1D>g<EFBFBD>}<7D>5<>5<>'<27>.<2E>.<2E>E<EFBFBD>:Q<><18>J<EFBFBD>J<EFBFBD>w<EFBFBD>'<27><1A>4<><1D>K<>E<EFBFBD>9<EFBFBD>TU<54>V<>W<> W<><18><05>y<EFBFBD> )<29> )<29><14>2<>2<>4<>4<> <20>M<><12><12><19>%<25>%<25>'<27>'<27> <20>!M<>N<>N<>#(<28> <20>!<21><15>'<27>E<EFBFBD><19>%<25><16>(<28>(<28><18> 5<> 5<> 7<>7<>$<24>O<>PU<50>y<EFBFBD>Y<><16><16>',<2C>#<23><1D><07><1D>e<EFBFBD><14>6<>A<EFBFBD>!<21>!<21>V<EFBFBD>,<2C>,<2C><11><19><19>1G<31>1G<31>1I<31>1I<31><1F><0E><0E>q<EFBFBD>)<29>7<>
"<22>$<24>+<2B>+<2B>.<2E>A<EFBFBD><18>|<7C>./<2F>+<2B><1E>/<2F> <1B>*1<>!<21>*<2A>D<EFBFBD>'<27><1A> <20>B<>5<EFBFBD>)<29>L<><12>rc<01> <00>V^8<>dQhRRRR/#)rrBrCr<00>boolr)rs"rrr<00>s<00><00><1D><1D>/<2F><1D>D<EFBFBD>rc <0A><><00>\V\4'd*VPfR#VPPV8H#\V\4'dVPV8H#\V\
4'dVP V8H#\V4p\V\4'dVPV8H#\V4FpW P8XgKR# R#)zp
Check whether the given control has the focus.
:param value: :class:`.UIControl` or :class:`.Window` instance.
FT) r7r-<00>current_bufferrIrrrLr r
r0r6)r(rB<00>elements&& r<00> has_focus<75>Layout.has_focus<75>s<><00><00>
<16>e<EFBFBD>S<EFBFBD> !<21> !<21><13>"<22>"<22>*<2A><1C><17>&<26>&<26>+<2B>+<2B>u<EFBFBD>4<> 4<> <15>e<EFBFBD>V<EFBFBD> $<24> $<24><17>&<26>&<26>%<25>/<2F> /<2F> <15>e<EFBFBD>Y<EFBFBD> '<27> '<27><17>'<27>'<27>5<EFBFBD>0<> 0<> <20><15>'<27>E<EFBFBD><19>%<25><16>(<28>(<28><1B>*<2A>*<2A>e<EFBFBD>3<>3<> $<24>E<EFBFBD>{<7B>G<EFBFBD><1E>"5<>"5<>5<>#<23> +<2B>rc<01><00>V^8<>dQhRR/#<00>rrrr)rs"rrr<00>s<00><00>'<27>'<27><19>'rc <0A><<00>VPR,P#)z9
Get the :class:`.UIControl` to currently has the focus.
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)rr=r1s&rrL<00>Layout.current_control<6F>s<00><00>
<14>{<7B>{<7B>2<EFBFBD><EFBFBD>&<26>&<26>&rc<01> <00>V^8<>dQhRRRR/#)rrNrrrr)rs"rrr<00>s<00><00> E<01> E<01>y<EFBFBD> E<01>T<EFBFBD> Erc <0A>z<00>VP4FpVPV8XgKW nR# \R4h)z3
Set the :class:`.UIControl` to receive the focus.
Nz(Control not found in the user interface.)r$r=r0rJ)r(rN<00>windows&& rrLr^<00>s:<00><00>
<1B>+<2B>+<2B>-<2D>F<EFBFBD><15>~<7E>~<7E><17>(<28>&,<2C>#<23><16>.<2E>
<19>C<>D<>Drc<01><00>V^8<>dQhRR/#)rrr
r)rs"rrr<00>s<00><00><1F><1F><06>rc <0A>(<00>VPR,#)z=Return the :class:`.Window` object that is currently focused.r])rr1s&rr0<00>Layout.current_window<6F>s<00><00><14>{<7B>{<7B>2<EFBFBD><EFBFBD>rc<01> <00>V^8<>dQhRRRR/#)rrBr
rrr)rs"rrr<00>s<00><00>"<22>"<22>F<EFBFBD>"<22>t<EFBFBD>"rc <0A><<00>VPPV4R#)z8Set the :class:`.Window` object to be currently focused.N)rr")r(rBs&&rr0rd<00>s<00><00> <0A> <0B> <0B><1A><1A>5<EFBFBD>!rc<01><00>V^8<>dQhRR/#<00>rrrTr)rs"rrr<00>s<00><00>9<>9<>d<EFBFBD>9rc <0A>4<00>VPVP9#)z#True if we are searching right now.)rLr r1s&r<00> is_searching<6E>Layout.is_searching<6E>s<00><00><14>#<23>#<23>t<EFBFBD>'8<>'8<>8<>8rc<01><00>V^8<>dQhRR/#)rrzBufferControl | Noner)rs"rrr<00>s<00><00> <18> <18>.B<> rc <0A><><00>VPp\V\4'dVPP V4#R#)zI
Return the :class:`.BufferControl` in which we are searching or `None`.
N)rLr7r r <00>get)r(rNs& r<00>search_target_buffer_control<6F>#Layout.search_target_buffer_control<6F>s7<00><00><17>&<26>&<26><07> <15>g<EFBFBD>2<> 3<> 3<><17>$<24>$<24>(<28>(<28><17>1<> 1<>rc<01><00>V^8<>dQhRR/#)rrzIterable[Window]r)rs"rrr<00>s<00><00><18><18>'7<>rc# <0A><>"<00>VP4FAp\V\4'gKVPP 4'gK=Vx<00>KC R#5i)zT
Return all the :class:`.Window` objects which are focusable (in the
'modal' area).
N)<05>walk_through_modal_arear7r
r=rK)r(rQs& r<00>get_focusable_windows<77>Layout.get_focusable_windows<77>s><00><00><00>
<16>-<2D>-<2D>/<2F>A<EFBFBD><19>!<21>V<EFBFBD>$<24>$<24><11><19><19>)?<3F>)?<3F>)A<>)A<><17><07>0<>s<00>'A<01>A<01>
Ac<01><00>V^8<>dQhRR/#)rrz list[Window]r)rs"rrr<00>s<00><00>Q<01>Q<01>|<7C>Qrc <0A>t<00>VPpVP4Uu.uF q"V9gK VNK up#uupi)z?
Return a list of :class:`.Window` objects that are focusable.
)r'rt)r(r'rQs& r<00>get_visible_focusable_windows<77>$Layout.get_visible_focusable_windows<77>s9<00><00> <1F>.<2E>.<2E><0F><1F>5<>5<>7<>P<>7<>a<EFBFBD><0F>;O<><01><01>7<>P<>P<><50>Ps<00>5<04>5c<01><00>V^8<>dQhRR/#)rr<00> Buffer | Noner)rs"rrrs<00><00><14><14> <0A>rc <0A>b<00>VPp\V\4'd VP#R#)z4
The currently focused :class:`~.Buffer` or `None`.
N)rLr7r rH<00>r(<00>
ui_controls& rrV<00>Layout.current_buffers+<00><00>
<1A>)<29>)<29>
<EFBFBD> <15>j<EFBFBD>-<2D> 0<> 0<><1D>$<24>$<24> $<24>rc<01> <00>V^8<>dQhRRRR/#)r<00> buffer_namer-rr{r)rs"rrr s<00><00> <14> <14>c<EFBFBD> <14>m<EFBFBD> rc <0A>"<00>VP4Fzp\V\4'gK\VP\4'gK=VPP
P V8XgKdVPP
u# R#)z\
Look in the layout for a buffer with the given name.
Return `None` when nothing was found.
N)r6r7r
r=r rHrI)r(r<>rQs&& r<00>get_buffer_by_name<6D>Layout.get_buffer_by_name s^<00><00>
<16><19><19><1B>A<EFBFBD><19>!<21>V<EFBFBD>$<24>$<24><1A>A<EFBFBD>I<EFBFBD>I<EFBFBD>}<7D>)M<>)M<><14>9<EFBFBD>9<EFBFBD>#<23>#<23>(<28>(<28>K<EFBFBD>7<><1C>9<EFBFBD>9<EFBFBD>+<2B>+<2B>+<2B><1D>rc<01><00>V^8<>dQhRR/#rhr)rs"rrrs<00><00>5<>5<>$<24>5rc <0A>:<00>VPp\V\4#)z<>
Return `True` if the currently focused control is a
:class:`.BufferControl`. (For instance, used to determine whether the
default key bindings should be active or not.)
)rLr7r r}s& r<00>buffer_has_focus<75>Layout.buffer_has_focuss<00><00><1A>)<29>)<29>
<EFBFBD><19>*<2A>m<EFBFBD>4<>4rc<01><00>V^8<>dQhRR/#r[r)rs"rrr"s<00><00>+<2B>+<2B>)<29>+rc <0A><><00>VPR,P# \d!TPR,Pu#i;i)z:
Get the :class:`.UIControl` to previously had the focus.
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>r])rr=<00>
IndexErrorr1s&r<00>previous_control<6F>Layout.previous_control!s><00><00>
 +<2B><17>;<3B>;<3B>r<EFBFBD>?<3F>*<2A>*<2A> *<2A><><19> +<2B><17>;<3B>;<3B>r<EFBFBD>?<3F>*<2A>*<2A> *<2A> +<2B>s<00><00>(A
<03> A
c<01><00>V^8<>dQhRR/#<00>rrrr)rs"rrr+s<00><00>+<2B>+<2B>D<EFBFBD>+rc <0A>f<00>\VP4^8<>dVPRRVnR#R#)z-
Give the focus to the last focused control.
Nr])<02>lenrr1s&r<00>
focus_last<EFBFBD>Layout.focus_last+s,<00><00> <0F>t<EFBFBD>{<7B>{<7B> <1B>a<EFBFBD> <1F><1E>+<2B>+<2B>c<EFBFBD>r<EFBFBD>*<2A>D<EFBFBD>K<EFBFBD> rc<01><00>V^8<>dQhRR/#r<>r)rs"rrr2s<00><00>'<27>'<27>D<EFBFBD>'rc <0A><00>VP4p\V4^8<>dOVPVP4pV^,\V4,pVP W,4R#R# \d^pL*i;i)z*
Focus the next visible/focusable Window.
N<EFBFBD>rxr<><00>indexr0rJr&<00>r(rOr<>s& r<00>
focus_next<EFBFBD>Layout.focus_next2<00>t<00><00><17>4<>4<>6<><07> <0E>w<EFBFBD><<3C>!<21> <1B> 3<><1F> <0A> <0A>d<EFBFBD>&9<>&9<>:<3A><05><1F><11><19>c<EFBFBD>'<27>l<EFBFBD>2<><05> <10>J<EFBFBD>J<EFBFBD>w<EFBFBD>~<7E> &<26> <1C><><1E> <1A><19><05> <1A><><00>A1<00>1 B<03>Bc<01><00>V^8<>dQhRR/#r<>r)rs"rrrBs<00><00>'<27>'<27><04>'rc <0A><00>VP4p\V4^8<>dOVPVP4pV^,
\V4,pVP W,4R#R# \d^pL*i;i)z.
Focus the previous visible/focusable Window.
Nr<EFBFBD>r<>s& r<00>focus_previous<75>Layout.focus_previousBr<>r<>c<01><00>V^8<>dQhRR/#<00>rr<00>Iterable[Container]r)rs"rrrRs<00><00>(<28>(<28>)<29>(rc# <0A>L"<00>\VP4Rjx<01>L
R#L5i)zH
Walk through all the layout nodes (and their children) and yield them.
N)r6rr1s&rr6<00> Layout.walkRs<00><00><00><18><04><0E><0E>'<27>'<27>'<27>s <00>$<01>"<04>$c<01><00>V^8<>dQhRR/#r<>r)rs"rrrXs<00><00> <1E> <1E>)<<3C> rc# <0A><>"<00>VPpVP4'g&WP9dVPV,pK;\V4Rjx<01>L
R#L5i)zV
Walk through all the containers which are in the current 'modal' part
of the layout.
N)r0<00>is_modalr!r6)r(<00>roots& rrs<00>Layout.walk_through_modal_areaXsE<00><00><00><1F>-<2D>-<2D><04><16>-<2D>-<2D>/<2F>/<2F>d<EFBFBD>.C<>.C<>&C<><17>(<28>(<28><14>.<2E>D<EFBFBD><17><04>:<3A><1D><1D>s<00>"A!<01>3A!<01>A<04>A!c<01><00>V^8<>dQhRR/#r<>r)rs"rrres<00><00> (<28> (<28>$<24> (rc <0A>Taa<02>/oRVV3RlloS!VP4SVnR#)z-
Update child->parent relationships mapping.
c<01> <00>V^8<>dQhRRRR/#)rr)r rrr)rs"rr<00>5Layout.update_parents_relations.<locals>.__annotate__ks<00><00> <18> <18>I<EFBFBD> <18>$<24> rc<01>P<<02>VP4FpVSV&S!V4K R#r<)<01> get_children)r)rP<00>parentsr6s& <20><>rr6<00>-Layout.update_parents_relations.<locals>.walkks$<00><><00><16>^<5E>^<5E>%<25><01><1E><07><01>
<EFBFBD><14>Q<EFBFBD><07>&rN)rr!)r(r<>r6s&@@r<00>update_parents_relations<6E>Layout.update_parents_relationses*<00><><00><15><07> <18> <18>
<0A>T<EFBFBD>^<5E>^<5E><1C> '<27><04>rc<01><00>V^8<>dQhRR/#r<>r)rs"rrrts<00><00><1F><1F>t<EFBFBD>rc <09>n<00>VPP4VPP4R#r<)r <00>clearr<00>resetr1s&rr<><00> Layout.resetts&<00><00>
<0A><19><19><1F><1F>!<21> <0C><0E><0E><1C><1C>rc<01> <00>V^8<>dQhRRRR/#)rrr rzContainer | Noner)rs"rrr}s<00><00><18><18>I<EFBFBD><18>2B<32>rc <0A>N<00>VPV,# \dR#i;i)zW
Return the parent container for the given container, or ``None``, if it
wasn't found.
N)r!<00>KeyErrorr>s&&r<00>
get_parent<EFBFBD>Layout.get_parent}s*<00><00>
 <18><17>(<28>(<28><19>3<> 3<><33><17> <18><17> <18>s <00><00> $<03>$)r!rrrLr0r r'r<) <20>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__r*r2r$r?r&rX<00>propertyrL<00>setterr0rjrortrxrVr<>r<>r<>r<>r<>r<>r6rsr<>r<>r<><00>__static_attributes__rrrrrs(<00><00><08> 0<>DU<01><1B>$<24>L<12>\<1D>2<0E>'<27><0E>'<27> <15><1B><1B> E<01><1C> E<01><0E><1F><0E><1F><14><1A><1A>"<22><1B>"<22><0E>9<><0E>9<><0E> <18><0E> <18><18>Q<01><0E><14><0E><14> <14><0E>5<><0E>5<><0E>+<2B><0E>+<2B>+<2B>'<27> '<27> (<28> <1E> (<28><1F><18>rc<01><00>]tRtRtRtR#)ri<>rN)r<>r<>r<>r<>r<>rrrrr<00>s<00><00>rc<01>$<00>V^8<>dQhRRRRRR/#)rrr rGrTrr<>r)rs"rrr<00>s"<00><00>4<>4<>I<EFBFBD>4<>D<EFBFBD>4<>=P<>4rc#<05><>"<00>V'd/\V\4'dVP4'gR#Vx<00>VP4Fp\ W!R7Rjx<01>L
K R#L
5i)z2
Walk through layout, starting at this container.
NrF)r7r<00>filterr<72>r6)rrGrPs&& rr6r6<00>sS<00><00><00> <14> <16>y<EFBFBD>"6<> 7<> 7<><19> <20> <20>"<22>"<22><0E>
<13>O<EFBFBD> <16> #<23> #<23> %<25><01><17><01>3<>3<>3<>&<26>3<>s<00>4A,<01>(A,<01>A*<06> A,N)rrr6)F)r<><00>
__future__r<00>typingrrr<00>prompt_toolkit.bufferr<00>
containersrrr r
r <00>controlsr r r<00>__all__r-rCr<00> Exceptionrr6rrr<00><module>r<>sk<00><01><04>#<23>-<2D>-<2D>(<28><02><02>D<01>C<> <02><07> <19><13>f<EFBFBD>i<EFBFBD><1C>=<3D>><3E><10>h<18>h<18>V  <09><19> <09>4<>4r