
    Vh	                    V    d Z ddlmZ ddlZddlZddlZdZd Zd Z	e
dk(  r e        yy)zProvides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection.    )annotationsNzansible_connection_cli_stub.pyc                 N   t         j                  j                  t              } t        j
                  g}t         j                  j                  d      }t         j                  j                  d      }t         j                  j                  d      }|rL|r|dddd|gz  }n?t        t        j                  j                  d            }|st	        j                  d	       | d
k(  r,t        j                  d   dk(  r|t	        j                  d       nf| dk(  r|ddgz  }nY| dk(  r|t        | d      gz  }nC| t        k(  r*|t         j                  j!                  |dt              gz  }n|t        | d      gz  }|t        j                  dd z  }t        j"                  |d   |       y)zMain entry point.ANSIBLE_TEST_ANSIBLE_LIB_ROOTCOVERAGE_CONFCOVERAGE_FILEz-mzcoverage.__main__runz--rcfilecoveragezERROR: Could not find `coverage` module. Did you use a virtualenv created without --system-site-packages or with the wrong interpreter?z	python.py   z-czaERROR: Use `python -c` instead of `python.py -c` to avoid errors when code coverage is collected.pytestzimporter.pyFzcli/scriptsTNr   )ospathbasename__file__sys
executableenvirongetbool	importlibutil	find_specexitargvfind_programNETWORKING_CLI_STUB_SCRIPTjoinexecv)nameargsansible_lib_rootcoverage_configcoverage_outputfounds         Y/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_util/target/injector/python.pymainr%      sb   77H%DNNDzz~~&EFjjnn_5Ojjnn_5OT.z?SSD11*=>E z { {88A;$HHxy		x  		dE*++	+	+.?YZ[[dD)**CHHQRLDHHT!Wd    c                   t         j                  j                  dt         j                  j                        }t         j                  j                  t              h}|r!t         j                  t         j                  z  nt         j                  }|j                  t         j                  j                        D ]  }t         j                  j                  t         j                  j                  ||             }||v rE|j                  |       t         j                  j                  |      svt        j                  ||      s|c S  t        d| d|      )z
    Find and return the full path to the named program, optionally requiring it to be executable.
    Raises an exception if the program is not found.
    PATHzExecutable "z" not found in path: )r   r   r   r   defpathabspathr   F_OKX_OKsplitpathsepr   addexistsaccess	Exception)r   r   r   seenmodebase	candidates          r$   r   r   1   s    
 ::>>&"''//2DGGOOH%&D *277RWWD

277??+ 	GGOOBGGLLt$<=	77>>)$9d)C	 tTJ
KKr&   __main__)__doc__
__future__r   importlib.utilr   r   r   r   r%   r   __name__ r&   r$   <module>r=      s=    a "  	 
= "JL. zF r&   