o
    ¯bP  ã                   @   sR   d Z ddlZG dd„ deƒZG dd„ deƒZG dd„ deƒZddd„Zdd„ ZdS )zf
A release-automation toolkit.

Don't use this outside of Twisted.

Maintainer: Christopher Armstrong
é    Nc                   @   ó   e Zd ZdZdS )ÚDirectoryExistsz2
    Some directory exists when it shouldn't.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r	   r	   ú8/usr/lib/python3/dist-packages/twisted/python/release.pyr      ó    r   c                   @   r   )ÚDirectoryDoesntExistz6
    Some directory doesn't exist when it should.
    Nr   r	   r	   r	   r
   r      r   r   c                   @   s   e Zd ZdS )ÚCommandFailedN)r   r   r   r	   r	   r	   r
   r   "   s    r   TFc                 C   sF   t d| ƒ |rtdƒ d¡rdS |rd|  } t | ¡dkr!t| ƒ‚dS )z½
    I'll try to execute C{command}, and if C{prompt} is true, I'll
    ask before running it.  If the command returns something other
    than 0, I'll raise C{CommandFailed(command)}.
    z--$zrun ?? ÚnNz%s > /dev/nullr   )ÚprintÚinputÚ
startswithÚosÚsystemr   )ÚcommandÚnullÚpromptr	   r	   r
   Úsh)   s   
ÿr   c              	   O   s4   t j d¡}z| |i |¤ŽW t  |¡ S t  |¡ w )NÚ.)r   ÚpathÚabspathÚchdir)ÚfÚargsÚkwÚorigdirr	   r	   r
   ÚrunChdirSafe:   s   r    )TF)r   r   ÚOSErrorr   r   r   r   r    r	   r	   r	   r
   Ú<module>   s   	
