+
    rh                     j    R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RIH	t	 R t
R tR	 tRR
 ltR# )zCSome general file utilities used that can be used by the Cloud SDK.)absolute_import)division)unicode_literalsN)encoding)	platformsc                 L    \         P                  ! \        P                  R4      # )z5Returns properly encoded system PATH variable string.PATH)encoding_utilGetEncodedValueosenviron     4/usr/lib/python3/dist-packages/fire/console/files.py_GetSystemPathr      s    		&	&rzz6	::r   c                   \        V\        4      '       d   \        RP                  V4      4      hV F  pVP	                  \
        P                  4       F  pVP                  R4      p\
        P                  P                  \
        P                  P                  W@4      V,           4      p\
        P                  P                  V4      '       g   K~  \
        P                  ! V\
        P                  4      '       g   K  Vu u # 	  K  	  R# )ai  Internal function to a find an executable.

Args:
  executable: The name of the executable to find.
  path: A list of directories to search separated by 'os.pathsep'.
  pathext: An iterable of file name extensions to use.

Returns:
  str, the path to a file on `path` with name `executable` + `p` for
    `p` in `pathext`.

Raises:
  ValueError: invalid input.
zr_FindExecutableOnPath(..., pathext='{0}') failed because pathext must be an iterable of strings, but got a string."N)
isinstancestr
ValueErrorformatsplitr   pathsepstrippathnormpathjoinisfileaccessX_OK)
executabler   pathextext	directoryfulls   &&&   r   _FindExecutableOnPathr%   !   s      
 !!'2 2
 cZZ

+	//#&iWWbggll9ACGHd			"))D"''":": ,  
r   c                 H    V \         P                  P                  8X  d   R# R# ).exe)r'   z.cmdz.batz.comz.ps1) z.sh)r   OperatingSystemWINDOWS)platforms   &r   _PlatformExecutableExtensionsr,   B   s"    **22233r   c                   V'       gG   \         P                  P                  V 4      ^,          '       d   \        RP	                  V 4      4      h\         P                  P                  V 4      '       d   \        RP	                  V 4      4      hVf   \        4       pMTpVe   TM&\        \        P                  P                  4       4      p\        WV4      # )a  Searches for `executable` in the directories listed in `path` or $PATH.

Executable must not contain a directory or an extension.

Args:
  executable: The name of the executable to find.
  path: A list of directories to search separated by 'os.pathsep'.  If None
    then the system PATH is used.
  pathext: An iterable of file name extensions to use.  If None then
    platform specific extensions are used.
  allow_extensions: A boolean flag indicating whether extensions in the
    executable are allowed.

Returns:
  The path of 'executable' (possibly with a platform-specific extension) if
  found and executable, None if not found.

Raises:
  ValueError: if executable has a path or an extension, and extensions are
    not allowed, or if there's an internal error.
zWFindExecutableOnPath({0},...) failed because first argument must not have an extension.zQFindExecutableOnPath({0},...) failed because first argument must not have a path.)r   r   splitextr   r   dirnamer   r,   r   r)   Currentr%   )r    r   r!   allow_extensionseffective_patheffective_pathexts   &&&&  r   FindExecutableOnPathr4   I   s    0 
bgg..z:1==
 <<BF:<NP P WW__Z  
 66<fZ6HJ J 
\#%NN")"5w9$44<<>@  
z0
2 2r   )NNF)__doc__
__future__r   r   r   r   fire.consoler   r	   r   r   r%   r,   r4   r   r   r   <module>r8      s2     J &  ' 	 2 ";
B)2r   