ó
[³XMc           @   s    d  Z  d d l m Z d d l m Z d d l m Z m Z d d l m	 Z	 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(   sB   
I am the support module for making a manhole server with twistd.
iÿÿÿÿ(   t   service(   t   pb(   t   usaget   util(   t   portalt   checkers(   t   strportsNt   Optionsc           B   sr   e  Z d  Z d d d d g d d e e j ƒ d g g Z d d	 d
 g g Z i d d 6Z d „  Z	 e	 Z
 d „  Z RS(   s	   [options]t   usert   ut   admins   Name of user to allow to log int   portt   ps   Port to listen ont
   tracebackst   Ts,   Allow tracebacks to be sent over the networkt   _usersc         C   s3   | d k r% t  j d d ƒ |  d <n
 | |  d <d S(   sB   Required.  '-' will prompt or read a password from stdin.
        t    t   -t   confirmi   t   passwordN(   R   R   (   R   t   getPassword(   t   selfR   (    (    s7   /usr/lib/python2.7/dist-packages/twisted/tap/manhole.pyt   opt_password   s    c         C   s#   |  j  d ƒ s |  j d ƒ n  d  S(   NR   R   (   t   has_keyR   (   R   (    (    s7   /usr/lib/python2.7/dist-packages/twisted/tap/manhole.pyt   postOptions)   s    (   t   __name__t
   __module__t   synopsist   strR   t   portnot   optParameterst   optFlagst   zsh_actionsR   t   opt_wR   (    (    (    s7   /usr/lib/python2.7/dist-packages/twisted/tap/manhole.pyR      s   	
c         C   s‡   |  d |  d |  d } } } t  j t j t j |  d |  j d ƒ ƒ ƒ t j i | | 6  g ƒ } t j | t	 j
 | |  d ƒ ƒ S(   NR   R   R   R   t	   namespace(   R   t   PortalR    t   Realmt   Servicet   getR   t'   InMemoryUsernamePasswordDatabaseDontUseR   R   t   PBServerFactory(   t   configR   R   R   R   (    (    s7   /usr/lib/python2.7/dist-packages/twisted/tap/manhole.pyt   makeService-   s
     %(   t   __doc__t   twisted.manholeR    t   twisted.spreadR   t   twisted.pythonR   R   t   twisted.credR   R   t   twisted.applicationR   t   ost   sysR   R*   (    (    (    s7   /usr/lib/python2.7/dist-packages/twisted/tap/manhole.pyt   <module>   s   