Files
ServerSync/lib/invoke/__pycache__/terminals.cpython-314.pyc

100 lines
9.4 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
t<10>i<EFBFBD><00><00><><00>Rt^RIHt^RIHtHtHtHt^RIt^RI t ^RI
t
^RI H t H t ]
PR8Ht]
PR8Xd^RIt^RIHtHtHtHtHt^RIHtHtHtM^RIt^RIt^RIt^RIt]
PR8XdRR ltMR
R ltR R lt RRlt!RRlt"]RRl4t#RRlt$RRlt%R#)z<>
Utility functions surrounding terminal devices & I/O.
Much of this code performs platform-sensitive branching, e.g. Windows support.
This is its own module to abstract away what would otherwise be distracting
logic-flow interruptions.
)<01>contextmanager)<04> Generator<6F>IO<49>Optional<61>TupleN)<02>
has_fileno<EFBFBD>isatty<74>win32)<05> Structure<72>c_ushort<72>windll<6C>POINTER<45>byref)<03>HANDLE<4C>_COORD<52> _SMALL_RECTc<00>r<00>V^8<>dQhR\\\,\\,3,/#<00><02><00>return<72>rr<00>int)<01>formats"<22>7/tmp/pip-target-zhdecbcm/lib/python/invoke/terminals.py<70> __annotate__r2s%<00><00> <20> <20>u<EFBFBD>X<EFBFBD>c<EFBFBD>]<5D>H<EFBFBD>S<EFBFBD>M<EFBFBD>9<>:<3A> <20>c<00><00>!RR\4p\PPp\PPp\
Vn\
\V4.VnV!R4pV!4pV!V\V44pV'dtVPPVPP,
^,pVPPVPP,
^,pWg3#R#)c<00>8<00>]tRt^3tR]3R]3R]3R]3R]3.tRtR#)<08>-_pty_size.<locals>.CONSOLE_SCREEN_BUFFER_INFO<46>dwSize<7A>dwCursorPosition<6F> wAttributes<65>srWindow<6F>dwMaximumWindowSize<7A>N) <09>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__rr r<00>_fields_<73>__static_attributes__r$rr<00>CONSOLE_SCREEN_BUFFER_INFOr3s1<00><00><19>6<EFBFBD>"<22>#<23>V<EFBFBD>,<2C><1E><08>)<29><1B>[<5B>)<29>&<26><06>/<2F> <0E>Hrr+i<><69><EFBFBD><EFBFBD><EFBFBD>NN)r
r <00>kernel32<33> GetStdHandle<6C>GetConsoleScreenBufferInfor<00>restyper <00>argtypesrr"<00>Right<68>Left<66>Bottom<6F>Top)r+r.r/<00>hstd<74>csbi<62>ret<65>sizex<65>sizeys r<00> _pty_sizer;2s<><00><00> <0E><19> <0E><1E><EFBFBD><EFBFBD>3<>3<> <0C>%+<2B>_<EFBFBD>_<EFBFBD>%O<>%O<>"<22>%<25> <0C><1C> <12> <13>.<2E> /<2F>/
<EFBFBD>"<22>+<2B>
<1C>C<EFBFBD> <20><04>)<29>+<2B><04>(<28><14>u<EFBFBD>T<EFBFBD>{<7B>;<3B><03> <0E><18>M<EFBFBD>M<EFBFBD>'<27>'<27>$<24>-<2D>-<2D>*<<3C>*<<3C><<3C>q<EFBFBD>@<40>E<EFBFBD><18>M<EFBFBD>M<EFBFBD>(<28>(<28>4<EFBFBD>=<3D>=<3D>+<<3C>+<<3C><<3C>q<EFBFBD>@<40>E<EFBFBD><18><<3C> <1F><1F> rc<00>r<00>V^8<>dQhR\\\,\\,3,/#rr)rs"rrrQs%<00><00> <14> <14>u<EFBFBD>X<EFBFBD>c<EFBFBD>]<5D>H<EFBFBD>S<EFBFBD>M<EFBFBD>9<>:<3A> rc<04>6<00>RpRp\P!V^^^^4p\P!\P
\ PV4p\P!W4vrEpWT3# \P\\\3dT#i;i)z;
Suitable for most POSIX platforms.
.. versionadded:: 1.0
<EFBFBD>HHHHr,) <0A>struct<63>pack<63>fcntl<74>ioctl<74>sys<79>stdout<75>termios<6F>
TIOCGWINSZ<EFBFBD>unpack<63>error<6F> TypeError<6F>IOError<6F>AttributeError)<07>size<7A>fmt<6D>buf<75>result<6C>rows<77>cols<6C>_s rr;r;Qs<><00><00><1C><04><15><03><14>k<EFBFBD>k<EFBFBD>#<23>q<EFBFBD>!<21>Q<EFBFBD><01>*<2A><03> <11><1A>[<5B>[<5B><13><1A><1A>W<EFBFBD>-?<3F>-?<3F><13>E<>F<EFBFBD>$<24>]<5D>]<5D>3<EFBFBD>7<>N<EFBFBD>D<EFBFBD><11><18><<3C> <1F><><17> <0C> <0C>i<EFBFBD><17>.<2E>A<> <11> <10><13> <0B> <11>s<00>AA/<00>/%B<03>Bc<00>F<00>V^8<>dQhR\\\3,/#r)rr)rs"rrrts<00><00> $<24> $<24>%<25><03>S<EFBFBD><08>/<2F> $rc<04>J<00>\4wrT;'g^PT;'g^3#)z<>
Determine current local pseudoterminal dimensions.
:returns:
A ``(num_cols, num_rows)`` two-tuple describing PTY size. Defaults to
``(80, 24)`` if unable to get a sensible result dynamically.
.. versionadded:: 1.0
)r;)rQrPs r<00>pty_sizerUts$<00><00><1B><1B>J<EFBFBD>D<EFBFBD> <10>J<EFBFBD>J<EFBFBD>B<EFBFBD><04>
<EFBFBD>
<EFBFBD><02> #<23>#rc<00>0<00>V^8<>dQhR\R\/#<00>r<00>streamr<00>r<00>bool)rs"rrr<00>s<00><00>9<>9<>b<EFBFBD>9<>T<EFBFBD>9rc<04><><00>\V4'gR#\P!4\P!VP 448H#)a<>
Detect if given stdin ``stream`` seems to be in the foreground of a TTY.
Specifically, compares the current Python process group ID to that of the
stream's file descriptor to see if they match; if they do not match, it is
likely that the process has been placed in the background.
This is used as a test to determine whether we should manipulate an active
stdin so it runs in a character-buffered mode; touching the terminal in
this way when the process is backgrounded, causes most shells to pause
execution.
.. note::
Processes that aren't attached to a terminal to begin with, will always
fail this test, as it starts with "do you have a real ``fileno``?".
.. versionadded:: 1.0
F)r<00>os<6F>getpgrp<72> tcgetpgrp<72>fileno)rXs&r<00>stdin_is_foregrounded_ttyr`<00>s2<00><00>& <16>f<EFBFBD> <1D> <1D><14> <0A>:<3A>:<3A><<3C>2<EFBFBD><<3C><<3C><06> <0A> <0A><0F>8<> 8<>8rc<00>0<00>V^8<>dQhR\R\/#rWrY)rs"rrr<00>s<00><00><1A><1A>r<EFBFBD><1A>d<EFBFBD>rc<00>f<00>\P!V4pV^,V^,r2\V\P,4p\V\P,4pV'*V'*V\P
,R9V\P ,R93p\V4#)<03>)<02><00>)<02><00>)rE<00> tcgetattrrZ<00>ECHO<48>ICANON<4F>VMIN<49>VTIME<4D>all)rX<00>attrs<72>lflags<67>cc<63>echo<68>icanon<6F> sentinelss& r<00>cbreak_already_setrt<00>s<><00><00> <14> <1D> <1D>f<EFBFBD> %<25>E<EFBFBD><16>q<EFBFBD><18>5<EFBFBD><11>8<EFBFBD>B<EFBFBD> <0F><06><17><1C><1C>%<25> &<26>D<EFBFBD> <11>&<26>7<EFBFBD>><3E>><3E>)<29> *<2A>F<EFBFBD>
<11><08> <12>
<EFBFBD>
<EFBFBD>7<EFBFBD><<3C><<3C><18>L<EFBFBD>(<28>
<EFBFBD>7<EFBFBD>=<3D>=<3D><19>\<5C>)<29> <06>I<EFBFBD> <0F>y<EFBFBD>><3E>rc<00>><00>V^8<>dQhR\R\R,/#)rrXr)NNN)rr)rs"rrr<00>s&<00><00>G<01>G<01> <0E>G<01><0E><1F> <20>Grc#<04><>"<00>\'g4\V4'd#\V4'd\V4'dRx<00>R#\P
!V4p\ P!V4Rx<00>\P!V\PV4R# \P!T\PT4i;i5i)z<>
Force local terminal ``stream`` be character, not line, buffered.
Only applies to Unix-based systems; on Windows this is a no-op.
.. versionadded:: 1.0
N)
<EFBFBD>WINDOWSrr`rtrErh<00>tty<74> setcbreak<61> tcsetattr<74> TCSADRAIN)rX<00> old_settingss& r<00>character_bufferedr}<00>s<><00><00><00> <10><07><15>f<EFBFBD>~<7E>~<7E>(<28><16>0<>0<> <1D>f<EFBFBD> %<25> %<25> <0A><1E>(<28>(<28><16>0<> <0C> <0B> <0A> <0A>f<EFBFBD><1D> G<01> <11> <13> <1D> <1D>f<EFBFBD>g<EFBFBD>&7<>&7<><1C> F<><46>G<EFBFBD> <1D> <1D>f<EFBFBD>g<EFBFBD>&7<>&7<><1C> F<>s<00>A2C <01>5B!<00>9(C <01>!(C <03> C c<00>0<00>V^8<>dQhR\R\/#<00>r<00>input_rrY)rs"rrr<00>s<00><00>2<>2<>b<EFBFBD>2<>T<EFBFBD>2rc<04><><00>\V4'gR#\PR8Xd\P!4#\
P
!V...R4wpp\ T;'d V^,VJ4#)z<>
Test ``input_`` to determine whether a read action will succeed.
:param input_: Input stream object (file-like).
:returns: ``True`` if a read should succeed, ``False`` otherwise.
.. versionadded:: 1.0
Tr g)rrC<00>platform<72>msvcrt<72>kbhit<69>selectrZ)r<><00>readsrRs& r<00>ready_for_readingr<67><00>sb<00><00> <16>f<EFBFBD> <1D> <1D><13>
<EFBFBD>|<7C>|<7C>w<EFBFBD><1E><15>|<7C>|<7C>~<7E><1D><1C>m<EFBFBD>m<EFBFBD>V<EFBFBD>H<EFBFBD>b<EFBFBD>"<22>c<EFBFBD>:<3A> <0B><05>q<EFBFBD>!<21><13>E<EFBFBD>0<>0<>e<EFBFBD>A<EFBFBD>h<EFBFBD>&<26>0<>1<>1rc<00>0<00>V^8<>dQhR\R\/#r)rr)rs"rrr<00>s<00><00> <0A> <0A>"<22> <0A><13> rc<04><><00>\'gp\V4'd_\V4'dN\P!V\
P R4p\\P!RV4^,4#^#)aX
Query stream ``input_`` to see how many bytes may be readable.
.. note::
If we are unable to tell (e.g. if ``input_`` isn't a true file
descriptor or isn't a valid TTY) we fall back to suggesting reading 1
byte only.
:param input: Input stream object (file-like).
:returns: `int` number of bytes to read.
.. versionadded:: 1.0
s <20>h)
rwrrrArBrE<00>FIONREADrr?rG)r<><00>fionreads& r<00> bytes_to_readr<64><00>sQ<00><00>$ <13>7<EFBFBD>v<EFBFBD>f<EFBFBD>~<7E>~<7E>*<2A>V<EFBFBD>*<<3C>*<<3C><18>;<3B>;<3B>v<EFBFBD>w<EFBFBD>'7<>'7<><15>?<3F><08><12>6<EFBFBD>=<3D>=<3D><13>h<EFBFBD>/<2F><01>2<>3<>3<> r)&<26>__doc__<5F>
contextlibr<00>typingrrrrr\r<>rC<00>utilrrr<>rwr<><00>ctypesr
r r r r<00>ctypes.wintypesrrrrAr?rErxr;rUr`rtr}r<>r<>r$rr<00><module>r<>s<><00><01><04>&<26>1<>1<> <09> <0A>
<EFBFBD>%<25> <0E>,<2C>,<2C>'<27>
!<21><07><04><07><<3C><<3C>7<EFBFBD><1A><11><06><06><<3C>;<3B><10><11><12><0E><07><<3C><<3C>7<EFBFBD><1A> <20>> <14>F $<24>9<>0<1A>,<10>G<01><10>G<01>42<>. r