ó
[³XMc           @   sn   d  d l  m Z d  d l m Z d  d l m Z d  d l Z d  d l Z d e j f d „  ƒ  YZ	 d „  Z
 d S(   iÿÿÿÿ(   t   usage(   t   app(   t   sobNt   ConvertOptionsc           B   sŸ   e  Z d  Z d d d d g d d d d g d d d	 d
 g d d d d g g Z d d d g d d d g g Z i d d 6d d 6Z i d d 6d d 6Z d „  Z RS(   s   Usage: tapconvert [options]t   int   is$   The filename of the tap to read fromt   outt   os   A filename to write the tap tot   typeint   ft   guesssP   The  format to use; this can be 'guess', 'python', 'pickle', 'xml', or 'source'.t   typeoutt   tt   sourcesC   The output format to use; this can be 'pickle', 'xml', or 'source'.t   decryptt   ds,   The specified tap/aos/xml file is encrypted.t   encryptt   es   Encrypt file before writings    (guess python pickle xml source)s   (pickle xml source)s   tap file to read froms   tap file to write toc         C   sƒ   |  d d  k r& t j d |  ƒ ‚ n  |  d d k r y t j |  d ƒ |  d <Wq t k
 r{ t j d |  d ƒ ‚ q Xn  d  S(   NR   s'   %s
You must specify the input filename.R   R
   s   Could not guess type for '%s'(   t   NoneR    t
   UsageErrorR   t	   guessTypet   KeyError(   t   self(    (    s>   /usr/lib/python2.7/dist-packages/twisted/scripts/tapconvert.pyt   postOptions!   s    		N(	   t   __name__t
   __module__t   synopsisR   t   optParameterst   optFlagst   zsh_actionst   zsh_actionDescrR   (    (    (    s>   /usr/lib/python2.7/dist-packages/twisted/scripts/tapconvert.pyR   	   s   		



c       	   C   s‰   t  ƒ  }  y |  j t j d ƒ Wn t j k
 r> } | GHnG Xt j |  d |  d |  j d pl t	 j	 d ƒ |  d |  d |  d ƒ d  S(	   Ni   R   R   R   s   Passphrase: R   R   R   (
   R   t   parseOptionst   syst   argvR    R   R   t   convertStylet   optst   getpass(   t   optionsR   (    (    s>   /usr/lib/python2.7/dist-packages/twisted/scripts/tapconvert.pyt   run,   s    		(   t   twisted.pythonR    t   twisted.applicationR   t   twisted.persistedR   R    R$   t   OptionsR   R&   (    (    (    s>   /usr/lib/python2.7/dist-packages/twisted/scripts/tapconvert.pyt   <module>   s
   #