
    ϪfP                     `    d Z ddlZ G d de      Z G d de      Z G d de      Zdd	Zd
 Zy)zf
A release-automation toolkit.

Don't use this outside of Twisted.

Maintainer: Christopher Armstrong
    Nc                       e Zd ZdZy)DirectoryExistsz2
    Some directory exists when it shouldn't.
    N__name__
__module____qualname____doc__     8/usr/lib/python3/dist-packages/twisted/python/release.pyr   r           	r   r   c                       e Zd ZdZy)DirectoryDoesntExistz6
    Some directory doesn't exist when it should.
    Nr   r
   r   r   r   r      r   r   r   c                       e Zd Zy)CommandFailedN)r   r   r   r
   r   r   r   r   "   s    r   r   c                     t        d|        |rt        d      j                  d      ry|rd| z  } t        j                  |       dk7  rt        |       y)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prompts      r   shr   )   sU     
%&&s+"W,	yyQG$$ r   c                     t         j                  j                  d      }	  | |i |t        j                  |       S # t        j                  |       w xY w)N.)r   pathabspathchdir)fargskworigdirs       r   runChdirSafer&   :   s=    ggooc"G$~"~
s	   > A)TF)r	   r   OSErrorr   r   r   r   r&   r
   r   r   <module>r(      s=    

	g 		7 		G 	%"r   