Format: application/x-python-code
⬇ Download File (2.1 KB)
   1  o
   2  
   3  ��h��@s�dZddlZddlZddlZejdkr ddlmZmZmZm	Z	n0ejdkr2ddl
   4  mZmZmZm	Z	nejdkrDddlmZmZmZm	Z	nddlmZmZmZm	Z	ddl
   5  mZmZmZGd	d
   6  �d
   7  e�Zdd�Zd
   8  d�ZdS)z0
   9  Utilities for working with external processes.
  10  �N�win32�)�system�	getoutput�	arg_split�	check_pid�cliZ
  11  emscripten)�getoutputerror�get_output_error_code�process_handlerc@seZdZdS)�FindCmdErrorN)�__name__�
  12  __module__�__qualname__�rr�Kc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/process.pyrsrcCs"t�|�}|durtd|��|S)a�Find absolute path to executable cmd in a cross platform manner.
  13  
  14      This function tries to determine the full path to a command line program
  15      using `which` on Unix/Linux/OS X and `win32api` on Windows.  Most of the
  16      time it will use the version that is first on the users `PATH`.
  17  
  18      Warning, don't use this to find IPython command line programs as there
  19      is a risk you will find the wrong one.  Instead find those using the
  20      following code and looking for the application itself::
  21  
  22          import sys
  23          argv = [sys.executable, '-m', 'IPython']
  24  
  25      Parameters
  26      ----------
  27      cmd : str
  28          The command line program to look for.
  29      Nzcommand could not be found: %s)�shutil�whichr)�cmd�pathrrr�find_cmds
  30  rcCs~t���dd�}d}|}tjdkr!t|�dkr|Stj�|�\}}|�d�}t|�dkr5d�	|dd��}||dkr<dp=|S)	z1 Return abbreviated version of cwd, e.g. d:mydir �\�/�r�������N)
  31  �os�getcwd�replace�sys�platform�lenr�
  32  splitdrive�split�join)�cwdZ	drivepart�tail�partsrrr�
  33  abbrev_cwd7s
  34  
  35  �r))�__doc__rrr r!Z_process_win32rrrrZ_process_cliZ_process_emscriptenZ_process_posixZ_process_commonr	r
  36  r�	Exceptionrrr)rrrr�<module>s
  37  
  38  
  39