Files
ServerSync/lib/paramiko/__pycache__/buffered_pipe.cpython-314.pyc

97 lines
8.8 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
u<10>i9<00><00>X<00>Rt^RIt^RIt^RIt^RIHt!RR]4t!RR4tR#)z<>
Attempt to generalize the "feeder" part of a `.Channel`: an object which can be
read from and closed, but is reading from a buffer fed by another thread. The
read operations are blocking and can have a timeout set.
N)<01>bc<00><00>]tRt^tRtRtR#)<04> PipeTimeoutzH
Indicates that a timeout was reached on a read from a `.BufferedPipe`.
<EFBFBD>N)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__<5F>__static_attributes__r<00><00>=/tmp/pip-target-zhdecbcm/lib/python/paramiko/buffered_pipe.pyrrs <00><00><08> r rc<00>ha<00>]tRt^'toRtRtRtRRltRtRt Rt
RR lt R
t R t R tR tVtR#)<0F> BufferedPipez<65>
A buffer that obeys normal read (with timeout) & close semantics for a
file or socket, but is fed data from another thread. This is used by
`.Channel`.
c<08><><00>\P!4Vn\P!VP4VnRVn\ P !R4VnRVnR#)N<>BF) <09> threading<6E>Lock<63>_lock<63> Condition<6F>_cv<63>_event<6E>array<61>_buffer<65>_closed<65><01>selfs&r <00>__init__<5F>BufferedPipe.__init__.sD<00><00><1E>^<5E>^<5E>%<25><04>
<EFBFBD><1C>&<26>&<26>t<EFBFBD>z<EFBFBD>z<EFBFBD>2<><04><08><1A><04> <0B><1C>{<7B>{<7B>3<EFBFBD>'<27><04> <0C><1C><04> r c<08><<00>VPPV4R#<00>N)r<00> frombytes<65>r<00>datas&&r <00>_buffer_frombytes<65>BufferedPipe._buffer_frombytes5s<00><00> <0C> <0C> <0C><1E><1E>t<EFBFBD>$r Nc<08><<00>VPRVP4#r )r<00>tobytes)r<00>limits&&r <00>_buffer_tobytes<65>BufferedPipe._buffer_tobytes8s<00><00><13>|<7C>|<7C>F<EFBFBD>U<EFBFBD>#<23>+<2B>+<2B>-<2D>-r c <0C>T<00>VPP4WnVP'g\ VP
4^8<>dVP 4MVP4VPP4R# TPP4i;i)z<>
Set an event on this buffer. When data is ready to be read (or the
buffer has been closed), the event will be set. When no data is
ready, the event will be cleared.
:param threading.Event event: the event to set/clear
N) r<00>acquirerr<00>lenr<00>set<65>clear<61>release)r<00>events&&r <00> set_event<6E>BufferedPipe.set_event;sl<00><00> <0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><1F>K<EFBFBD> <14>|<7C>|<7C>|<7C>s<EFBFBD>4<EFBFBD><<3C><<3C>0<>1<EFBFBD>4<><15> <09> <09> <0B><15> <0B> <0B> <0A> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s <00>AB <00> B'c <0C>f<00>VPP4VPeVPP4VP \ V44VP P4VPP4R# TPP4i;i)z<>
Feed new data into this pipe. This method is assumed to be called
from a separate thread, so synchronization is done.
:param data: the data to add, as a ``str`` or ``bytes``
N) rr,rr.r$rr<00>
notify_allr0r"s&&r <00>feed<65>BufferedPipe.feedRst<00><00> <0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><13>{<7B>{<7B>&<26><14> <0B> <0B><0F><0F>!<21> <10> "<22> "<22>1<EFBFBD>T<EFBFBD>7<EFBFBD> +<2B> <10>H<EFBFBD>H<EFBFBD> <1F> <1F> !<21> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s <00>AB<00>B0c <0C><00>VPP4\VP4^8XdVPP 4R#VPP 4R# TPP 4i;i)a,
Returns true if data is buffered and ready to be read from this
feeder. A ``False`` result does not mean that the feeder has closed;
it means you may need to wait before more data arrives.
:return:
``True`` if a `read` call would immediately return at least one
byte; ``False`` otherwise.
FT<EFBFBD>rr,r-rr0rs&r <00>
read_ready<EFBFBD>BufferedPipe.read_readybse<00><00> <0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><12>4<EFBFBD><<3C><<3C> <20>A<EFBFBD>%<25><1C> <11>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><18> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s <00>A0<00>0B c <0C><><00>\4pVPP4\VP4^8Xd<>VP
'dVVPP 4#VR8Xd \4h\VP4^8XdVP
'gm\P!4pVPPV4VfKbV\P!4V,
,pVR8:gK<>\4h\VP4V8:dYVP4pVPRVPe-VP
'gVPP4M VPV4pVPRV1VPP 4V# TPP 4i;i)a<>
Read data from the pipe. The return value is a string representing
the data received. The maximum amount of data to be received at once
is specified by ``nbytes``. If a string of length zero is returned,
the pipe has been closed.
The optional ``timeout`` argument can be a nonnegative float expressing
seconds, or ``None`` for no timeout. If a float is given, a
`.PipeTimeout` will be raised if the timeout period value has elapsed
before any data arrives.
:param int nbytes: maximum number of bytes to read
:param float timeout:
maximum seconds to wait (or ``None``, the default, to wait forever)
:return: the read data, as a ``str`` or ``bytes``
:raises:
`.PipeTimeout` -- if a timeout was specified and no data was ready
before that timeout
gN<>NNN)<0E>bytesrr,r-rrr0r<00>timer<00>waitr)rr/)r<00>nbytes<65>timeout<75>out<75>thens&&& r <00>read<61>BufferedPipe.readtsX<00><00>*<14>g<EFBFBD><03> <0C>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><12>4<EFBFBD><<3C><<3C> <20>A<EFBFBD>%<25><17><<3C><<3C><<3C><1E>0 <11>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>-<1B>c<EFBFBD>><3E>%<25>-<2D>'<27><1B>4<EFBFBD><<3C><<3C>(<28>A<EFBFBD>-<2D>t<EFBFBD>|<7C>|<7C>|<7C><1F>9<EFBFBD>9<EFBFBD>;<3B>D<EFBFBD><18>H<EFBFBD>H<EFBFBD>M<EFBFBD>M<EFBFBD>'<27>*<2A><1E>*<2A><1F>4<EFBFBD>9<EFBFBD>9<EFBFBD>;<3B><14>#5<>5<><07>"<22>c<EFBFBD>><3E>"-<2D>-<2D>/<2F><13>4<EFBFBD><<3C><<3C> <20>F<EFBFBD>*<2A><1A>*<2A>*<2A>,<2C><03><18>L<EFBFBD>L<EFBFBD><11>O<EFBFBD><18>K<EFBFBD>K<EFBFBD>+<2B>T<EFBFBD>\<5C>\<5C>\<5C><18>K<EFBFBD>K<EFBFBD>%<25>%<25>'<27><><1A>*<2A>*<2A>6<EFBFBD>2<><03><18>L<EFBFBD>L<EFBFBD><17>&<26><17>)<29> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><12>
<EFBFBD><EFBFBD> <11>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s0<00>+G<00>G<00>.<G<00>+1G<00>!'G<00> A G<00>.;G<00>G!c <0C>\<00>VPP4VP4pVPRVPe-VP
'gVPP 4VVPP4# TPP4i;i)z<>
Clear out the buffer and return all data that was in it.
:return:
any data that was in the buffer prior to clearing it out, as a
`str`
r=)rr,r)rrrr/r0)rrCs& r <00>empty<74>BufferedPipe.empty<74>sx<00><00> <0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><16>&<26>&<26>(<28>C<EFBFBD><14> <0C> <0C>Q<EFBFBD><0F><14> <0B> <0B>'<27><14><1C><1C><1C><14> <0B> <0B>!<21>!<21>#<23><16> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s<00><B<00>B<00>B+c <0C>@<00>VPP4RVnVPP 4VP
eVP
P 4VPP4R# TPP4i;i)z<>
Close this pipe object. Future calls to `read` after the buffer
has been emptied will return immediately with an empty string.
TN)rr,rrr5rr.r0rs&r <00>close<73>BufferedPipe.close<73>si<00><00>
<0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><1F>D<EFBFBD>L<EFBFBD> <10>H<EFBFBD>H<EFBFBD> <1F> <1F> !<21><13>{<7B>{<7B>&<26><14> <0B> <0B><0F><0F>!<21> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s <00>A B<00>Bc <0C><><00>VPP4\VP4VPP 4# TPP 4i;i)zQ
Return the number of bytes buffered.
:return: number (`int`) of bytes buffered
r9rs&r <00>__len__<5F>BufferedPipe.__len__<5F>sF<00><00> <0A>
<EFBFBD>
<EFBFBD><1A><1A><1C> !<21><16>t<EFBFBD>|<7C>|<7C>$<24> <10>J<EFBFBD>J<EFBFBD> <1E> <1E> <20><>D<EFBFBD>J<EFBFBD>J<EFBFBD> <1E> <1E> <20>s <00>A <00> A')rrrrrr )rrrr r
rr$r)r2r6r:rErHrKrNr <00>__classdictcell__)<01> __classdict__s@r rr'sB<00><><00><00><08> <1D>%<25>.<2E>!<21>.!<21> !<21>$4<13>l!<21>$ !<21>
!<21>
!r r) r
rrr?<00> paramiko.utilr<00>IOErrorrrrr r <00><module>rTs0<00><01>&<04>  <0A><10> <0B><1B> <09>'<27> <09>m!<21>m!r