U
    ýÇ-eä  ã                   @   sD   d Z ddlZddlZddlZddlmZ dd„ Zdd„ Zd	d
„ ZdS )až  cli-specific implementation of process utilities.

cli - Common Language Infrastructure for IronPython. Code
      can run on any operating system. Check os.name for os-
      specific settings.

This file is only meant to be imported by process.py, not by end-users.

This file is largely untested. To become a full drop-in process
interface for IronPython will probably require you to help fill
in the details. 
é    Né   )Ú	arg_splitc                 C   s<   t j | ¡}d|_d|_t jjj|_d|_t jj	 
|¡}dS )zY
    system(cmd) should work in a cli environment on Mac OSX, Linux,
    and Windows
    TFN)ÚSystemÚDiagnosticsÚProcessStartInfoÚRedirectStandardOutputÚRedirectStandardErrorÚProcessWindowStyleÚNormalÚWindowStyleÚUseShellExecuteÚProcessÚStart)ÚcmdÚpsiÚreg© r   ú[/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/IPython/utils/_process_cli.pyÚsystem   s    r   c                 C   sX   t j | ¡}d|_d|_t jjj|_d|_t jj	 
|¡}|j}| ¡ }|j}| ¡ }|S )z\
    getoutput(cmd) should work in a cli environment on Mac OSX, Linux,
    and Windows
    TF)r   r   r   r   r   r	   r
   r   r   r   r   ZStandardOutputZ	ReadToEndÚStandardError)r   r   r   ZmyOutputÚoutputZmyErrorÚerrorr   r   r   Ú	getoutput&   s    r   c                 C   sH   zt jj | ¡ W dS  t jk
r,   Y dS  t jk
rB   Y dS X dS )z<
    Check if a process with the given PID (pid) exists
    TFN)r   r   r   ZGetProcessByIdZInvalidOperationExceptionZArgumentException)Úpidr   r   r   Ú	check_pid8   s    r   )	Ú__doc__Zclrr   ÚosZ_process_commonr   r   r   r   r   r   r   r   Ú<module>   s   