
    IR-e                     ,    d Z ddlZddlZd Zd Zd ZdS )z1Utilities and extensions for use with `argparse`.    Nc                     t          | t                    s6t          j                            |           rt          j        |  d          t          j                            |           S )z
    An argument type (for use with the ``type=`` argument to
    `argparse.ArgumentParser.add_argument` which determines if the argument is
    an existing directory (and returns the absolute path).
    zK is not a directory or does not exist (the directory must be created first))
isinstancestrospathisdirargparseArgumentTypeErrorabspathargs    6lib/python3.11/site-packages/astropy/utils/argparse.py	directoryr      sh     c3 
BGMM#$6$6 
(      
 
 	

 7??3    c                     t          |           } t          j        | t          j                  st	          j        |  d          | S )z
    An argument type (for use with the ``type=`` argument to
    `argparse.ArgumentParser.add_argument` which determines if the argument is
    a directory that exists and is readable (and returns the absolute path).
    z8 exists but is not readable with its current permissions)r   r   accessR_OKr	   r
   r   s    r   readable_directoryr      sM     C..C9S"'"" 
(LLL
 
 	
 Jr   c                     t          |           } t          j        | t          j                  st	          j        |  d          | S )z
    An argument type (for use with the ``type=`` argument to
    `argparse.ArgumentParser.add_argument` which determines if the argument is
    a directory that exists and is writeable (and returns the absolute path).
    z9 exists but is not writeable with its current permissions)r   r   r   W_OKr	   r
   r   s    r   writeable_directoryr   '   sM     C..C9S"'"" 
(MMM
 
 	
 Jr   )__doc__r	   r   r   r   r    r   r   <module>r      sV    7 7  				            r   