Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/internet/__pycache__/_dumbwin32proc.cpython-39.pyc
Ðазад
a k�h�1 � @ s� d Z ddlZddlZddlmZ ddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl mZmZ ddlmZ ddlmZmZmZ ddlmZ e�� Zde_d d � ZG dd� dej�Zd d� Zdd� Zeeee�G dd� dej e��Z!dS )z< Windows Process Management, used with reactor.spawnProcess � N)�implementer)�_pollingfile�error)�BaseProcess)� IConsumer�IProcessTransport� IProducer)�quoteArguments� c C s t | � tj�� d S �N)�print�sys�stdout�flush)�msg� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/internet/_dumbwin32proc.py�debug$ s r c @ s e Zd Zdd� Zdd� ZdS )�_Reaperc C s || _ d S r )�proc)�selfr r r r �__init__* s z_Reaper.__init__c C s@ t �| jjd�t jkrdS t�| jj�}| �� | j�|� dS �Nr ) � win32eventZWaitForSingleObjectr �hProcessZ WAIT_OBJECT_0�win32processZGetExitCodeProcessZ deactivateZprocessEnded)r ZexitCoder r r � checkWork- s ��z_Reaper.checkWorkN)�__name__� __module__�__qualname__r r r r r r r ) s r c C s\ t | ��@}|�d�dkr:|�d��d�}|W d � S W d � n1 sN0 Y dS )a Look for a #! line, and return the value following the #! if one exists, or None if this file is not a script. I don't know if there are any conventions for quoting in Windows shebang lines, so this doesn't support any; therefore, you may not pass any arguments to scripts invoked as filters. That's probably wrong, so if somebody knows more about the cultural expectations on Windows, please feel free to fix. This shebang line support was added in support of the CGI tests; appropriately enough, I determined that shebang lines are culturally accepted in the Windows world through this page:: http://www.cgi101.com/learn/connect/winxp.html @param filename: str representing a filename @return: a str representing another filename. � z#!i � N)�open�read�readline�strip)�filename�f�exer r r �_findShebang9 s r) c C s | j d dkS )z� Determine if a pywintypes.error is telling us that the given process is 'not a valid win32 application', i.e. not a PE format executable. @param pywinerr: a pywintypes.error instance raised by CreateProcess @return: a boolean r � )�args)Zpywinerrr r r �_invalidWin32AppT s r, c @ s� e Zd ZdZdZdd� Zdd� Zdd� Zd d � Zdd� Z d d� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zed1�d2d3�Zd4S )5�Processa� A process that integrates with the Twisted event loop. If your subprocess is a python program, you need to: - Run python.exe with the '-u' command line option - this turns on unbuffered I/O. Buffering stdout/err/in can cause problems, see e.g. http://support.microsoft.com/default.aspx?scid=kb;EN-US;q1903 - If you don't want Windows messing with data passed over stdin/out/err, set the pipes to be in binary mode:: import os, sys, mscvrt msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) r c s$ t j��|� t��|� t�� }d|_t�|d�\�_ }t�|d�\�_ } t�|d�\} �_t��jtj dd� t�� � |� _| � _| � _tj� _t�� }t�|�j |ddtj�}t��j � |�_ t�|�j |ddtj�}t��j � |�_ t�|�j|ddtj�}t��j� |�_tj�� ���|�p0i � dd� �� � D ��dd� |D �}t!|����rlt�"��n����r�t�"��n��� �����fdd �} z | � W n� t#j$�yz } z�t%|��s�t&|��n�t'��}|du �r�t&d � ��nzt(|�}|�)d�� t!|���}|�z | � W nJ t#j$�yd } z.t%|��rHt&d||f ��t&|��W Y d}~n d}~0 0 W Y d}~n d}~0 0 t�| � t�|� t�| � t �*�j �fdd ��j+��_,t �*�j �fdd ��j-��_.t �/�j�j0��_1�j,�j.�j1fD ]}��2|� �q�j3�4�� ��2t5��� dS )z- Create a new child process. r r Nc S s"