
    B/gm	                         S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSK	J
r
Jr  S r\S	:X  a	   \" 5         gg! \
 a"  r\R                  " \" \5      5         SrCgSrCff = f)
a  
Utility for locating the module (or package's __init__.py)
associated with a given console_script name
and verifying it contains the PYTHON_ARGCOMPLETE_OK marker.

Such scripts are automatically generated and cannot contain
the marker themselves, so we defer to the containing module or package.

For more information on setuptools console_scripts, see
https://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-creation

Intended to be invoked by argcomplete's global completion function.
    N)
EntryPoint)entry_points)Iterable   )ArgcompleteMarkerNotFoundfindc                     [         R                  S   n [        R                  R	                  U 5      n[        5       n[         R                  S:  a  US   nU Vs/ s H(  o3R                  U:X  d  M  UR                  S:X  d  M&  UPM*     nnU(       d  [        S5      eUS   nUR                  R                  SS5      u  pV[        U 5       nUR                  5       nS S S 5        SR                  XV5      W;  a  [        S5      eS	R                  U5      U;  a  [        S5      e[        [        US
S95       nUR                  S5      n	S S S 5        SW	;  a  [        S5      eg s  snf ! , (       d  f       N= f! , (       d  f       N6= f)Nr   )      console_scriptsz$no entry point found matching scriptr   :zfrom {} import {}z&does not appear to be a console scriptzsys.exit({}())T)return_packagei   PYTHON_ARGCOMPLETE_OKzmarker not found)sysargvospathbasenameimportlib_entry_pointsversion_infonamegroupr   valuesplitopenreadformatr   )
script_pathr   r   epentry_pointmodule_namefunction_namefscriptheads
             C/usr/lib/python3/dist-packages/argcomplete/_check_console_script.pymainr'      sU   ((1+K 77K(D)?)AL '!#$56!-c2DBRXXQbEbBLc'(NOOq/K!,!2!2!8!8a!@K 
k	a 
!!+=VK'(PQQ}-V;'(PQQ 
d;t4	5vvd| 
6d*'(:;; +% d 
	 
6	5s*   E#1E#E#E(7E9(
E69
F__main__)__doc__r   r   importlib.metadatar   r   r   typingr   _check_moduler   r   r'   __name__eexitstr     r&   <module>r3      sb    
 
 ) E  :"<J z  % Qs   8 A AA 