ó
[³XMc           @   sŠ   d  d l  m Z d  d l m Z m Z m Z d  d l m Z d  d l Z d  d l	 Z	 d e j
 f d „  ƒ  YZ
 d e j f d „  ƒ  YZ d S(	   iÿÿÿÿ(   t   log(   t   appt   servicet   internet(   t	   copyrightNt   ServerOptionsc           B   s)   e  Z d  Z d d d g g Z d „  Z RS(   s   Usage: twistd [options]t   nodaemont   ns   (for backwards compatability).c         C   s"   d t  j GHt  j  GHt j ƒ  d S(   s,   Print version information and exit.
        s&   twistd (the Twisted Windows runner) %sN(   R   t   versiont   syst   exit(   t   self(    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyt   opt_version   s    (   t   __name__t
   __module__t   synopsist   optFlagsR   (    (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyR      s   t   WindowsApplicationRunnerc           B   s    e  Z d  Z d „  Z d „  Z RS(   sn   
    An ApplicationRunner which avoids unix-specific things. No
    forking, no PID files, no privileges.
    c         C   s0   t  j |  _ t  j |  _ t j |  j d ƒ d S(   s4   
        Do pre-application-creation setup.
        t   rundirN(   R	   t   stdoutt	   oldstdoutt   stderrt	   oldstderrt   ost   chdirt   config(   R   (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyt   preApplication!   s    c         C   sz   t  j |  j ƒ j ƒ  t j |  j |  j d ƒ t j t j d d „  ƒ d ƒ |  j	 d |  j |  j ƒ t j d ƒ d S(   s<   
        Start the application and run the reactor.
        t   no_savegš™™™™™¹?c           S   s   d  S(   N(   t   None(    (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyt   <lambda>0   s    i    s   Server Shut Down.N(   R   t   IServicet   applicationt   privilegedStartServiceR   t   startApplicationR   R   t   TimerServicet   startReactorR   R   R   R    t   msg(   R   (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyt   postApplication*   s
    (   R   R   t   __doc__R   R%   (    (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyR      s   		(   t   twisted.pythonR    t   twisted.applicationR   R   R   t   twistedR   R	   R   R   t   ApplicationRunnerR   (    (    (    s;   /usr/lib/python2.7/dist-packages/twisted/scripts/_twistw.pyt   <module>   s
   