Files
ServerSync/lib/prompt_toolkit/completion/__pycache__/nested.cpython-314.pyc

57 lines
5.2 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<00><01><><00>Rt^RIHt^RIHtHtHtHtHt^RI H
t
H t H t ^RI Ht^RIHtR.t]]]]]],R] 3,3,t!RR] 4tR#) zA
Nestedcompleter for completion of hierarchical data structures.
)<01> annotations)<05>Any<6E>Iterable<6C>Mapping<6E>Set<65>Union)<03> CompleteEvent<6E> Completer<65>
Completion)<01> WordCompleter)<01>Document<6E>NestedCompleterNc<01>X<00>]tRt^tRtR RRlltRRlt]RRl4tRR lt R
t
R #) r aw
Completer which wraps around several other completers, and calls any the
one that corresponds with the first word of the input.
By combining multiple `NestedCompleter` instances, we can achieve multiple
hierarchical levels of autocompletion. This is useful when `WordCompleter`
is not sufficient.
If you need multiple levels, check out the `from_nested_dict` classmethod.
c<01>$<00>V^8<>dQhRRRRRR/#)<07><00>optionszdict[str, Completer | None]<5D> ignore_case<73>bool<6F>return<72>None<6E>)<01>formats"<22>G/tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/completion/nested.py<70> __annotate__<5F>NestedCompleter.__annotate__s$<00><00>'<27>'<27>2<>'<27>AE<41>'<27> <0A>'<27>c <09><00>WnW nR#)N<>rr)<03>selfrrs&&&r<00>__init__<5F>NestedCompleter.__init__s<00><00><1F> <0C>&<26>rc<01><00>V^8<>dQhRR/#)rr<00>strr)rs"rrr%s<00><00>V<01>V<01>#<23>Vrc <09>@<00>RVP: RVP: R2#)zNestedCompleter(z, ignore_case=<3D>)r)rs&r<00>__repr__<5F>NestedCompleter.__repr__%s$<00><00>!<21>$<24>,<2C>,<2C>!1<><1E><04>@P<>@P<>?S<>ST<53>U<>Urc<01> <00>V^8<>dQhRRRR/#)r<00>data<74>
NestedDictrr r)rs"rrr)s<00><00>$<1C>$<1C>J<EFBFBD>$<1C>?<3F>$rc <0A>f<00>/pVP4F<>wr4\V\4'dWBV&K!\V\4'dVP V4W#&KL\V\
4'd)VP \P V44W#&K<>VeQhRW#&K<> V!V4#)a"
Create a `NestedCompleter`, starting from a nested dictionary data
structure, like this:
.. code::
data = {
'show': {
'version': None,
'interfaces': None,
'clock': None,
'ip': {'interface': {'brief'}}
},
'exit': None
'enable': None
}
The value should be `None` if there is no further completion at some
point. If all values in the dictionary are None, it is also possible to
use a set instead.
Values in this data structure can be a completers as well.
N)<07>items<6D>
isinstancer <00>dict<63>from_nested_dict<63>set<65>fromkeys)<05>clsr(r<00>key<65>values&& rr.<00> NestedCompleter.from_nested_dict(s<><00><00>202<30><07><1E>*<2A>*<2A>,<2C>J<EFBFBD>C<EFBFBD><19>%<25><19>+<2B>+<2B>$<24><03> <0C><1B>E<EFBFBD>4<EFBFBD>(<28>(<28>"<22>3<>3<>E<EFBFBD>:<3A><07> <0C><1B>E<EFBFBD>3<EFBFBD>'<27>'<27>"<22>3<>3<>D<EFBFBD>M<EFBFBD>M<EFBFBD>%<25>4H<34>I<><07> <0C><1C>}<7D>$<24>}<7D>#<23><07> <0C>'<27><13>7<EFBFBD>|<7C>rc<01>$<00>V^8<>dQhRRRRRR/#)r<00>documentr <00>complete_eventrrzIterable[Completion]r)rs"rrrOs)<00><00>K<01>K<01> <20>K<01>2?<3F>K<01> <1D>Krc# <09><>"<00>VPP4p\VP4\V4,
pRV9d<>VP4^,pVPP V4pVexV\V4RP4p\V4\V4,
V,p\ VVPV,
R7p VPW<>4Rjx<01>L
R#R#\\VPP44VPR7pVPW4Rjx<01>L
R#L[L5i)<04> N)<01>cursor_position)r) <0A>text_before_cursor<6F>lstrip<69>len<65>splitr<00>getr r:<00>get_completionsr <00>list<73>keysr)
rr6r7<00>text<78> stripped_len<65>
first_term<EFBFBD> completer<65>remaining_text<78> move_cursor<6F> new_documents
&&& rr@<00>NestedCompleter.get_completionsOs<00><00><00><18>*<2A>*<2A>1<>1<>3<><04><1A>8<EFBFBD>6<>6<>7<>#<23>d<EFBFBD>)<29>C<> <0C> <0F>$<24>;<3B><1D><1A><1A><1C>a<EFBFBD><1F>J<EFBFBD><1C> <0C> <0C>(<28>(<28><1A>4<>I<EFBFBD><19>$<24>!%<25>c<EFBFBD>*<2A>o<EFBFBD>&7<>!8<>!?<3F>!?<3F>!A<><0E>!<21>$<24>i<EFBFBD>#<23>n<EFBFBD>*=<3D>=<3D> <0C>L<> <0B>'<27>"<22>$,<2C>$<<3C>$<<3C>{<7B>$J<> <12> <0C>
%<25>4<>4<>\<5C>R<>R<>R<>%<25>&<26><14>T<EFBFBD>\<5C>\<5C>&<26>&<26>(<28>)<29>t<EFBFBD>7G<37>7G<37><0E>I<EFBFBD>!<21>0<>0<><18>J<> J<> J<>S<01> K<01>s%<00>C-E<01>/E <04>0AE<01>E <04>E<01> E)rrN)T) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__rr%<00> classmethodr.r@<00>__static_attributes__rrrr r s3<00><00> <08>'<27> V<01><11>$<1C><11>$<1C>LK<01>Kr)rO<00>
__future__r<00>typingrrrrr<00>prompt_toolkit.completionrr r
<00>(prompt_toolkit.completion.word_completerr <00>prompt_toolkit.documentr <00>__all__r"r)r rrr<00><module>rXs\<00><01><04>#<23>5<>5<>J<>J<>B<>,<2C> <1C>
<1D><07><15>S<EFBFBD>%<25><03>S<EFBFBD><13>X<EFBFBD>t<EFBFBD>Y<EFBFBD> ><3E>?<3F>?<3F> @<40>
<EFBFBD>ZK<01>i<EFBFBD>ZKr