ó
N
­Nc           @   s–   d  Z  d d l m Z d d l m Z m Z m Z d d l m Z d d l	 m
 Z
 m Z m Z d d l Z d e
 j e j f d „  ƒ  YZ d	 „  Z d S(
   s>   
I am the support module for making a ftp server with twistd.
iÿÿÿÿ(   t   internet(   t   portalt   checkerst   strcred(   t   ftp(   t   usaget	   deprecatet   versionsNt   Optionsc           B   s~   e  Z d  Z d d d d g d d d d g d	 d
 d d g g Z e j d i e j d d ƒ d 6ƒ Z d
 Z d „  Z	 d „  Z
 RS(   sP   [options].
    WARNING: This FTP server is probably INSECURE do not use it.
    t   portt   pt   2121s   set the port numbert   roott   rs   /usr/local/ftps    define the root of the ftp-site.t   userAnonymoust    t	   anonymouss   Name of the anonymous user.t
   optActionst   descrs   root of the ftp sitec         O   s-   t  j j |  | | Ž |  j t j ƒ  ƒ d  S(   N(   R   R   t   __init__t
   addCheckerR   t   AllowAnonymousAccess(   t   selft   at   kw(    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyR   $   s    c         C   sj   | |  d <t  j |  j t j d d d d ƒ ƒ } t j | d t d d ƒ|  j t	 j
 | d	 t ƒƒ d
 S(   s•   
        Specify a file containing username:password login info for
        authenticated connections. (DEPRECATED; see --help-auth instead)
        s   password-filet   Twistedi   i   i    t   categoryt
   stackleveli   t   cacheN(   R   t   getDeprecationWarningStringt   opt_password_fileR   t   Versiont   warningst   warnt   DeprecationWarningR   R   t   FilePasswordDBt   True(   R   t   filenamet   msg(    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyR   )   s
    
!(   t   __name__t
   __module__t   synopsist   optParametersR   t   Completionst   CompleteDirst   compDatat   longdescR   R   (    (    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyR      s   		c         C   sª   t  j ƒ  } t  j |  d ƒ } t j | |  j d g  ƒ ƒ } |  d | _ |  d | _ | | _ t  j | _	 y t
 |  d ƒ } Wn t k
 r™ d } n Xt j | | ƒ S(   NR   t   credCheckersR   R	   iI  (   R   t
   FTPFactoryt   FTPRealmR   t   Portalt   gett   tldR   t   FTPt   protocolt   intt   KeyErrorR    t	   TCPServer(   t   configt   fR   R
   t   portno(    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyt   makeService6   s    	
(   t   __doc__t   twisted.applicationR    t   twisted.credR   R   R   t   twisted.protocolsR   t   twisted.pythonR   R   R   R    R   t   AuthOptionMixinR=   (    (    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyt   <module>   s   "