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

110 lines
14 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i<EFBFBD>!<00><01><><00>^RIHt^RIt^RIt^RIt^RIt^RIHt^RIH t H
t
H t H t H t HtHt^RIHt.R+OtR]P$9t]!R R
R 7t!R R] ],4t!R R]
R,4t!RR] ]]3,4t]!4tRRltRRltRRltRRltRRltRRlt RRlt!RRlt"]!R 4t#R!R"lt$R#R$lt%R%R&lt&]] .]'3,]'3,t(R'R(lt)R,R)R*llt*R#)-<2D>)<01> annotationsN)<01>deque)<07>Callable<6C>ContextManager<65>Dict<63> Generator<6F>Generic<69>TypeVar<61>Union)<01>wcwidth<74>Event<6E> DummyContextzsphinx.ext.autodoc<6F>_SenderT)<01> covariantc<01>r<00>]tRt^-tRtRRRlltRRltRRltR R
ltR R lt R Rlt
RRlt Rt R#)r a}
Simple event to which event handlers can be attached. For instance::
class Cls:
def __init__(self):
# Define event. The first parameter is the sender.
self.event = Event(self)
obj = Cls()
def handler(sender):
pass
# Add event handler by using the += operator.
obj.event += handler
# Fire event.
obj.event()
Nc<01>$<00>V^8<>dQhRRRRRR/#)<07><00>senderr<00>handlerz Callable[[_Sender], None] | None<6E>return<72>None<6E>)<01>formats"<22>;/tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/utils.py<70> __annotate__<5F>Event.__annotate__Bs$<00><00><1C><1C><1D><1C>(H<><1C> <0A><1C>c <09><<00>Wn.VnVe W, pR#R#<00>N)r<00> _handlers)<03>selfrrs&&&r<00>__init__<5F>Event.__init__Bs"<00><00><1D> <0B>:<<3C><04><0E> <12> <1E> <10>O<EFBFBD>D<EFBFBD> rc<01><00>V^8<>dQhRR/#<00>rrrr)rs"rrrKs<00><00>!<21>!<21>$<24>!rc <0A>P<00>VPFpV!VP4K R#)z Fire event.N<>r r<00>r!rs& r<00>__call__<5F>Event.__call__Ks<00><00><1B>~<7E>~<7E>G<EFBFBD> <13>D<EFBFBD>K<EFBFBD>K<EFBFBD> <20>&rc<01><00>V^8<>dQhRR/#r%r)rs"rrrPs<00><00><0F><0F>d<EFBFBD>rc <0A><00>V!4R#)z!Alias for just calling the event.Nr<00>r!s&r<00>fire<72>
Event.firePs<00><00> <0C>rc<01> <00>V^8<>dQhRRRR/#<00>rr<00>Callable[[_Sender], None]rrr)rs"rrrTs<00><00>'<27>'<27>#<<3C>'<27><14>'rc <0A><<00>VPPV4R#)z{
Add another handler to this callback.
(Handler should be a callable that takes exactly one parameter: the
sender object.)
N)r <00>appendr(s&&r<00> add_handler<65>Event.add_handlerTs<00><00> <0A><0E><0E><1D><1D>g<EFBFBD>&rc<01> <00>V^8<>dQhRRRR/#r1r)rs"rrr]s<00><00>+<2B>+<2B>&?<3F>+<2B>D<EFBFBD>+rc <0A>`<00>WP9dVPPV4R#R#)z&
Remove a handler from this callback.
N)r <00>remover(s&&r<00>remove_handler<65>Event.remove_handler]s%<00><00> <13>n<EFBFBD>n<EFBFBD> $<24> <10>N<EFBFBD>N<EFBFBD> !<21> !<21>'<27> *<2A> %rc<01> <00>V^8<>dQhRRRR/#<00>rrr2rzEvent[_Sender]r)rs"rrrd<00><00><00><14><14> 9<><14>n<EFBFBD>rc <0A>(<00>VPV4V#)z3
`event += handler` notation for adding a handler.
)r5r(s&&r<00>__iadd__<5F>Event.__iadd__ds<00><00> <0A><18><18><17>!<21><13> rc<01> <00>V^8<>dQhRRRR/#r=r)rs"rrrkr>rc <0A>(<00>VPV4V#)z5
`event -= handler` notation for removing a handler.
)r:r(s&&r<00>__isub__<5F>Event.__isub__ks<00><00> <0A><1B><1B>G<EFBFBD>$<24><13> rr'r) <0A>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__r"r)r.r5r:r@rD<00>__static_attributes__rrrr r -s/<00><00><08>(<1C>!<21>
<0F>'<27>+<2B><14><14>rc<01>2<00>]tRt^stRtRRltRRltRtR#)rz-
(contextlib.nested is not available on Py3)
c<01><00>V^8<>dQhRR/#r%r)rs"rr<00>DummyContext.__annotate__xs<00><00> <0A> <0A>4<EFBFBD> rc <09><00>R#rrr-s&r<00> __enter__<5F>DummyContext.__enter__x<00><00><00> rc<01> <00>V^8<>dQhRRRR/#)r<00>a<>objectrrr)rs"rrrN{s<00><00> <0A> <0A>6<EFBFBD> <0A>d<EFBFBD> rc <09><00>R#rr)r!rTs&*r<00>__exit__<5F>DummyContext.__exit__{rRrrN)rFrGrHrIrJrPrWrKrrrrrss<00><00><08> <0A> <0A> rc<01>Fa<00>]tRt^tRt^@t^tRV3RlltRRltRt V;t
#)<07>_CharSizesCachez
Cache for wcwidth sizes.
c<01><00>V^8<>dQhRR/#r%r)rs"rr<00>_CharSizesCache.__annotate__<5F>s<00><00>1<>1<>$<24>1rc <09>B<<01>\SV`4\4VnR#r)<04>superr"r<00> _long_strings)r!<00> __class__s&<26>rr"<00>_CharSizesCache.__init__<5F>s<00><><00> <0A><07><18><1A>).<2E><17><04>rc<01> <00>V^8<>dQhRRRR/#<00>r<00>string<6E>strr<00>intr)rs"rrr\<00>s<00><00><16><16>#<23><16>#<23>rc <09>^a<00>\V4^8Xd\^\V44pM\V3RlV44pVSV&\V4SP8<>dRSP
pVP V4\V4SP8<>dVP4pVS9dSVV#)<02>c3<01>6<"<00>TFpSV,x<00>K R#5irr)<03>.0<EFBFBD>cr!s& <20>r<00> <genexpr><3E>._CharSizesCache.__missing__.<locals>.<genexpr><3E>s<00><><00><00>1<>&<26>Q<EFBFBD><14>a<EFBFBD><17><17>&<26>s<00>) <09>len<65>maxr <00>sum<75>LONG_STRING_MIN_LENr_r4<00>MAX_LONG_STRINGS<47>popleft)r!rd<00>result<6C> long_strings<67> key_to_removesf& r<00> __missing__<5F>_CharSizesCache.__missing__<5F>s<><00><><00> <0F>v<EFBFBD>;<3B>!<21> <1B><18><11>G<EFBFBD>F<EFBFBD>O<EFBFBD>,<2C>F<EFBFBD><18>1<>&<26>1<>1<>F<EFBFBD><1E><04>V<EFBFBD> <0C> <0F>v<EFBFBD>;<3B><14>1<>1<> 1<><1F>-<2D>-<2D>L<EFBFBD> <18> <1F> <1F><06> '<27><12><<3C> <20>4<EFBFBD>#8<>#8<>8<> ,<2C> 4<> 4<> 6<> <0A> <20>D<EFBFBD>(<28><1C>]<5D>+<2B><15> r)r_) rFrGrHrIrJrqrrr"rwrK<00> __classcell__)r`s@rrZrZs*<00><><00><08><1D><17><19><14>1<>1<>
<16>rrZc<01> <00>V^8<>dQhRRRR/#rcr)rs"rrr<00>s<00><00>%<25>%<25>s<EFBFBD>%<25>s<EFBFBD>%rc<05><00>\V,#)z7
Return width of a string. Wrapper around ``wcwidth``.
)<01>_CHAR_SIZES_CACHE)rds&r<00>
get_cwidthr}<00>s<00><00> <1D>V<EFBFBD> $<24>$rc<01><00>V^8<>dQhRR/#<00>rr<00>boolr)rs"rrr<00>s<00><00>&<26>&<26><14>&rc<05>"<00>\\R4#)z}
Returns `True` when the Python implementation supports
suspend-to-background. This is typically `False' on Windows systems.
<EFBFBD>SIGTSTP)<02>hasattr<74>signalrrr<00>suspend_to_background_supportedr<64><00>s<00><00>
<13>6<EFBFBD>9<EFBFBD> %<25>%rc<01><00>V^8<>dQhRR/#rr)rs"rrr<00>s<00><00>#<23>#<23>D<EFBFBD>#rc<05>(<00>\PR8H#)z!
True when we are using Windows.
<EFBFBD>win32)<02>sys<79>platformrrr<00>
is_windowsr<EFBFBD><00>s<00><00> <0F><<3C><<3C>7<EFBFBD> "<22>"rc<01><00>V^8<>dQhRR/#rr)rs"rrr<00>s<00><00>
<11>
<11>D<EFBFBD>
rc<05>J<00>\PR8Xd^RIHpV!4#R#)zK
True when we are using Windows, but VT100 escape sequences are supported.
r<EFBFBD><00><01>is_win_vt100_enabledF)r<>r<><00>prompt_toolkit.output.windows10r<30>r<>s r<00>is_windows_vt100_supportedr<64><00>s<00><00> <0B>|<7C>|<7C>w<EFBFBD><1E>H<>#<23>%<25>%<25> rc<01><00>V^8<>dQhRR/#rr)rs"rrr<00>s<00><00>S<01>S<01><04>Src<05>~<00>\PR8H;'d$\PP RR4R8H#)z/
True when the ConEmu Windows console is used.
r<EFBFBD><00>
ConEmuANSI<EFBFBD>OFF<46>ON)r<>r<><00>os<6F>environ<6F>getrrr<00>is_conemu_ansir<69><00>s/<00><00> <0F><<3C><<3C>7<EFBFBD> "<22> R<> R<>r<EFBFBD>z<EFBFBD>z<EFBFBD>~<7E>~<7E>l<EFBFBD>E<EFBFBD>'J<>d<EFBFBD>'R<>Rrc<01><00>V^8<>dQhRR/#rr)rs"rrr<00>s<00><00>J<01>J<01><04>Jrc<05>Z<00>\P!4PPR8H#)z2
True when the current thread is the main thread.
<EFBFBD> _MainThread)<04> threading<6E>current_threadr`rFrrr<00>in_main_threadr<64><00>s$<00><00> <15> #<23> #<23> %<25> /<2F> /<2F> 8<> 8<>M<EFBFBD> I<>Irc<01><00>V^8<>dQhRR/#rr)rs"rrr<00>s<00><00>*<2A>*<2A>t<EFBFBD>*rc<05>h<00>\PPRR4pVP4R9#)z<
True if env variable is set to true (true, TRUE, True, 1).
<EFBFBD>PROMPT_TOOLKIT_BELL<4C>true)<02>1r<31>)r<>r<>r<><00>lower<65><01>values r<00>get_bell_environment_variabler<65><00>s*<00><00> <0F>J<EFBFBD>J<EFBFBD>N<EFBFBD>N<EFBFBD>0<>&<26> 9<>E<EFBFBD> <10>;<3B>;<3B>=<3D>M<EFBFBD> )<29>)rc<01><00>V^8<>dQhRR/#)rrrer)rs"rrr<00>s<00><00>&<26>&<26>s<EFBFBD>&rc<05>B<00>\PPRR4#)z&Return the $TERM environment variable.<2E>TERM<52>)r<>r<>r<>rrr<00>get_term_environment_variabler<65><00>s<00><00> <0A>:<3A>:<3A>><3E>><3E>&<26>"<22> %<25>%r<00>_Tc<01>$<00>V^8<>dQhRRRRRR/#)r<00>itemszlist[_T]<5D>weightsz list[int]rzGenerator[_T, None, None]r)rs"rrr<00>s$<00><00>3<0F>3<0F> <13>3<0F>'<27>3<0F><1E>3rc#<05>d"<00>\V4\V48XgQh\V4^8<>gQh.p.p\W4F0wrEV^8<>gKVPV4VPV4K2 TpTpV'g \R4hVUu.uFp^NK pp\V4p\ V4p ^pRp
V
'dcRp
\\ V4W4FEwr<>p W{,Wl,\ V 4, 8gK+Vx<00>W{;;,^, uu&Rp
KG KjV^, pKxuupi5i)a<>
Generator that keeps yielding items from the items list, in proportion to
their weight. For instance::
# Getting the first 70 items from this generator should have yielded 10
# times A, 20 times B and 40 times C, all distributed equally..
take_using_weights(['A', 'B', 'C'], [5, 10, 20])
:param items: List of items to take from.
:param weights: Integers representing the weight. (Numbers have to be
integers, not floats.)
z+Did't got any items with a positive weight.TF)rn<00>zipr4<00>
ValueErrorro<00>range<67>float) r<>r<><00>items2<73>weights2<73>item<65>w<>i<> already_taken<65>
item_count<EFBFBD>
max_weight<EFBFBD>adding<6E>item_i<5F>weights && r<00>take_using_weightsr<73><00>s<00><00><00> <0F>u<EFBFBD>:<3A><13>W<EFBFBD><1C> %<25>%<25> %<25> <0E>u<EFBFBD>:<3A><01>><3E><19>><3E><10>F<EFBFBD><11>H<EFBFBD><16>u<EFBFBD>&<26><07><04> <0C>q<EFBFBD>5<EFBFBD> <12>M<EFBFBD>M<EFBFBD>$<24> <1F> <14>O<EFBFBD>O<EFBFBD>A<EFBFBD> <1E>'<27>
<13>E<EFBFBD><16>G<EFBFBD> <11><18>F<>G<>G<>!&<26>&<26><05>1<EFBFBD>Q<EFBFBD><05>M<EFBFBD>&<26><14>U<EFBFBD><1A>J<EFBFBD><14>W<EFBFBD><1C>J<EFBFBD> <09>A<EFBFBD>
<0E><15><06><14><1A>F<EFBFBD>(+<2B>E<EFBFBD>*<2A>,=<3D>u<EFBFBD>(N<>$<24><06>f<EFBFBD> <20>(<28>1<EFBFBD>:<3A><05>j<EFBFBD>8I<38>+I<>I<><1E>J<EFBFBD>!<21>)<29>Q<EFBFBD>.<2E>)<29>!<21>F<EFBFBD> )O<01>
<EFBFBD>Q<EFBFBD><06><01><>#'<27>s*<00>AD0<01> 1D0<01>?D0<01> D+<04>$D0<01>>=D0<01>0D0c<01> <00>V^8<>dQhRRRR/#)rr<>zCallable[[], str] | strrrer)rs"rrr"<00><00><00><1A><1A>)<29><1A>c<EFBFBD>rc<05>Z<00>\V4'd\V!44#\V4#)z$Turn callable or string into string.)<03>callable<6C>to_strrer<>s&rr<>r<>"<00>!<00><00><0F><05><EFBFBD><EFBFBD><15>e<EFBFBD>g<EFBFBD><EFBFBD><1E><12>5<EFBFBD>z<EFBFBD>rc<01> <00>V^8<>dQhRRRR/#)rr<>zCallable[[], int] | intrrfr)rs"rrr*r<>rc<05>Z<00>\V4'd\V!44#\V4#)zTurn callable or int into int.)r<><00>to_intrfr<>s&rr<>r<>*r<>rc<01> <00>V^8<>dQhRRRR/#)rr<><00>AnyFloatrr<>r)rs"rrr5s<00><00><1C><1C>H<EFBFBD><1C><15>rc<05>Z<00>\V4'd\V!44#\V4#)z"Turn callable or float into float.)r<><00>to_floatr<74>r<>s&rr<>r<>5s"<00><00><0F><05><EFBFBD><EFBFBD><17><05><07> <20> <20><14>U<EFBFBD>|<7C>rc<01> <00>V^8<>dQhRRRR/#)r<00>termz
str | Nonerr<>r)rs"rrr=s<00><00>
/<2F>
/<2F>:<3A>
/<2F><14>
/rc<05><><00>Vf*\\PPRR44#VP 4R9#)z<>
True if this terminal type is considered "dumb".
If so, we should fall back to the simplest possible form of line editing,
without cursor positioning and color support.
r<EFBFBD>r<>)<02>dumb<6D>unknown)<05>is_dumb_terminalr<6C>r<>r<>r<>)r<>s&rr<>r<>=s5<00><00> <0C>|<7C><1F><02>
<EFBFBD>
<EFBFBD><0E><0E>v<EFBFBD>r<EFBFBD> :<3A>;<3B>;<3B> <0F>:<3A>:<3A><<3C>.<2E> .<2E>.r)r rr}r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r)+<2B>
__future__rr<>r<>r<>r<><00> collectionsr<00>typingrrrrr r
r r <00>__all__<5F>modules<65>SPHINX_AUTODOC_RUNNINGrr rrerfrZr|r}r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrr<00><module>r<>s<00><01>"<22> <09> <0A>
<EFBFBD><10><1D><02><02><02><1C> <02><07>(.<2E><13><1B><1B><<3C><16>
<11>)<29>t<EFBFBD>
,<2C><07>C<14>G<EFBFBD>G<EFBFBD> <1C>C<14>L  <0A>><3E>$<24>'<27>  <0A>&<16>d<EFBFBD>3<EFBFBD><03>8<EFBFBD>n<EFBFBD>&<16>R$<24>%<25><11>%<25>&<26>#<23>
<11>S<01>J<01>*<2A>&<26>
 <0A>T<EFBFBD>]<5D><02>3<0F>l<1A><1A> <11><18>"<22>e<EFBFBD>)<29>$<24>e<EFBFBD>+<2B> ,<2C><08><1C>
/<2F>
/r