| Server IP : 138.197.176.125 / Your IP : 216.73.217.55 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/internet/__pycache__/ |
Upload File : |
U
��W[� � @ s d Z ddlmZmZ ddlZddlZddlmZ ddlm Z m
Z
ddlmZ ddl
mZ ddlmZ d d d
�ZG dd� de�ZG d
d� de j�Zdi dddfdd�ZG dd� de j�Zdi ddfdd�ZG dd� de j�Zdi ddfdd�Zdd� Zdd� Zdd� ZdddddgZdS )!z
Utility methods.
� )�division�absolute_importN��wraps)�protocol�defer)�failure)�reraise)�BytesIOc C sD |d krddl m} t�� }| |�}|�|||ft|� ||� |S )Nr )�reactor)�twisted.internetr r �DeferredZspawnProcess�tuple)r �
executable�args�env�pathr �d�p� r �8/usr/lib/python3/dist-packages/twisted/internet/utils.py�_callProtocolWithDeferred s r c @ s e Zd ZdZdd� ZdS )�_UnexpectedErrorOutputay
Standard error data was received where it was not expected. This is a
subclass of L{IOError} to preserve backward compatibility with the previous
error behavior of L{getProcessOutput}.
@ivar processEnded: A L{Deferred} which will fire when the process which
produced the data on stderr has ended (exited and all file descriptors
closed).
c C s t �| d|f � || _d S )Nzgot stderr: %r)�IOError�__init__�processEnded)�self�textr r r r r , s z_UnexpectedErrorOutput.__init__N)�__name__�
__module__�__qualname__�__doc__r r r r r r ! s
r c @ s: e Zd ZdZddd�Zdd� Zdd� Zd d
� Zdd� Zd
S )�
_BackRelaya�
Trivial protocol for communicating with a process and turning its output
into the result of a L{Deferred}.
@ivar deferred: A L{Deferred} which will be called back with all of stdout
and, if C{errortoo} is true, all of stderr as well (mixed together in
one string). If C{errortoo} is false and any bytes are received over
stderr, this will fire with an L{_UnexpectedErrorOutput} instance and
the attribute will be set to L{None}.
@ivar onProcessEnded: If C{errortoo} is false and bytes are received over
stderr, this attribute will refer to a L{Deferred} which will be called
back when the process ends. This C{Deferred} is also associated with
the L{_UnexpectedErrorOutput} which C{deferred} fires with earlier in
this case so that users can determine when the process has actually
ended, in addition to knowing when bytes have been received via stderr.
r c C s( || _ t� | _|r| j| _n| j| _d S �N)�deferredr
�s�errReceivedIsGood�errReceived�errReceivedIsBad)r r$ �errortoor r r r E s
z_BackRelay.__init__c C sF | j d k rBt�� | _t|| j�}| j �t�|�� d | _ | j� � d S r# )
r$ r r
�onProcessEndedr �errbackr ZFailureZ transportZloseConnection)r r �errr r r r( M s
z_BackRelay.errReceivedIsBadc C s | j �|� d S r# �r% �write�r r r r r r&