ó
[łXMc           @   s   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z m	 Z	 m
 Z
 m Z d d l Z d e j f d     YZ d	   Z d S(
   s>   
I am the support module for making a ftp server with twistd.
i˙˙˙˙(   t   ftp(   t   usage(   t   internet(   t   errort   portalt   checkerst   credentialsNt   Optionsc           B   sV   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
 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.s   password-files,   username:password-style credentials databaseN(   t   __name__t
   __module__t   synopsist   Nonet   optParameterst   longdesc(    (    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyR      s   c         C   sç   t  j   } t  j |  d  } t j |  } | j t j   t j	  |  d d  k	 rz | j t j |  d d t  n  |  d | _ |  d | _ | | _ t  j | _ y t |  d  } Wn t k
 rÖ d } n Xt j | |  S(   NR   s   password-filet   cacheR   R   iI  (   R    t
   FTPFactoryt   FTPRealmR   t   Portalt   registerCheckerR   t   AllowAnonymousAccessR   t
   IAnonymousR   t   FilePasswordDBt   Truet   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   makeService    s    #	
(   t   __doc__t   twisted.protocolsR    t   twisted.pythonR   t   twisted.applicationR   t   twisted.credR   R   R   R   t   os.patht   osR   R(   (    (    (    s3   /usr/lib/python2.7/dist-packages/twisted/tap/ftp.pyt   <module>   s   "