+
    DfjpZ                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
HtHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHtHtHtHtHt ^ R
I H!t!H"t"H#t#  ! R R4      t$ ! R R]$4      t% ! R R]$4      t& ! R R4      t' ! R R4      t(R t)R%R lt*R t+R t, ! R R4      t-R t.R t/ ! R R4      t0 ! R R ]Pb                  ]04      t2R! t3R" t4R# t5R$ t6R# )&    N)
attrgetter)	copyrightloggerplugin)reactorsservice)NoSuchReactorinstallReactor)defer)_ISupportsExitSignalCapturing)sob)failureloglogfileruntimeusageutil)namedAnynamedModulequalc                   0   a  ] tR t^t o RtR tR tRtV tR# )_BasicProfilerz
@ivar saveStats: if C{True}, save the stats information instead of the
    human readable format
@type saveStats: C{bool}

@ivar profileOutput: the name of the file use to print profile data.
@type profileOutput: C{str}
c                    Wn         W n        R # NprofileOutput	saveStats)selfr   r   s   &&&9/usr/lib/python3/dist-packages/twisted/application/app.py__init___BasicProfiler.__init__%   s    *"    c                :    RV RV 2pVR,          p\        V4      h)z
Helper method to report an import error with a profile module. This
has to be explicit because some of these modules are removed by
distributions due to them being non-free.
zFailed to import module : z
This is most likely caused by your operating system not including
the module due to it being non-free. Either do not use the option
--profile, or install the module; your operating system vendor
may provide it in a separate package.
)
SystemExit)r   moduleess   &&& r   _reportImportError!_BasicProfiler._reportImportError)   s1     'vhb4	  	 mr"   r   N)	__name__
__module____qualname____firstlineno____doc__r    r)   __static_attributes____classdictcell____classdict__s   @r   r   r      s     # r"   r   c                   *   a  ] tR t^9t o RtR tRtV tR# )ProfileRunnerz)
Runner for the standard profile module.
c                T    ^ RI pXP                  4       pVP	                  VP
                  4       V P                  '       d   VP                  V P                  4       R# \        P                  \        V P                  R4      up\        n
         VP                  4        V\        P                  u\        n
        pVP                  4        R#   \         d   pT P                  RT4        Rp?LRp?ii ; i  T\        P                  u\        n
        pTP                  4        i ; i)z*
Run reactor under the standard profiler.
Nprofilea)r7   ImportErrorr)   Profileruncallrunr   
dump_statsr   sysstdoutopenprint_statsclose)r   reactorr7   r'   ptmps   &&    r   r<   ProfileRunner.run>   s    	2 OO			'++>>>LL++,!jj$t/A/A3*GOC"%szz
C		  	2##Iq11	2 #&szz
C		s#   C C9 C6C11C69.D' Nr+   r,   r-   r.   r/   r<   r0   r1   r2   s   @r   r5   r5   9   s      r"   r5   c                   *   a  ] tR t^Tt o RtR tRtV tR# )CProfileRunnerz!
Runner for the cProfile module.
c                    ^ RI p^ RIpXP	                  4       pVP                  VP                  4       V P                  '       d   VP                  V P                  4       R# \        V P                  R4      ;_uu_ 4       pXP                  WVR7      pVP                  4        VP                  R4       VP                  4        RRR4       R#   \         d   pT P                  RT4        Rp?LRp?ii ; i  + '       g   i     R# ; i)z*
Run reactor under the cProfile profiler.
NcProfilew)stream)rL   pstatsr9   r)   r:   r;   r<   r   r=   r   r@   Stats
strip_dirs
sort_statsrA   )r   rC   rL   rP   r'   rD   rN   r(   s   &&      r   r<   CProfileRunner.runY   s    	3 			'++>>>LL++,d((#..&LLL2R 	 /.  	3##J22	3 /..s$   C AC:C7C22C7:D	rG   NrH   r2   s   @r   rJ   rJ   T   s        r"   rJ   c                   6   a  ] tR t^ot o RtR]R]/tR tRt	V t
R# )AppProfilerz
Class which selects a specific profile runner based on configuration
options.

@ivar profiler: the name of the selected profiler.
@type profiler: C{str}
r7   cprofilec                f   VP                  R R4      pVP                  RR4      pVP                  RR4      P                  4       V n        V P                  V P                  9   d7   V P                  V P                  ,          ! W24      pVP                  V n        R# \        RV P                   24      h)	savestatsFr7   NprofilerrW   zUnsupported profiler name: )getlowerrZ   	profilersr<   r%   )r   optionsr   r   rZ   s   &&   r   r    AppProfiler.__init__z   s    KKU3	It4J
;AAC==DNN*~~dmm4]NH||DH:4==/JKKr"   )rZ   r<   N)r+   r,   r-   r.   r/   r5   rJ   r]   r    r0   r1   r2   s   @r   rV   rV   o   s&      M:~FIL Lr"   rV   c                   F   a  ] tR t^t o RtRtR tR tR tR t	R t
RtV tR# )		AppLoggera-  
An L{AppLogger} attaches the configured log observer specified on the
commandline to a L{ServerOptions} object, a custom L{logger.ILogObserver},
or a legacy custom {log.ILogObserver}.

@ivar _logfilename: The name of the file to which to log, if other than the
    default.
@type _logfilename: C{str}

@ivar _observerFactory: Callable object that will create a log observer, or
    None.

@ivar _observer: log observer added at C{start} and removed at C{stop}.
@type _observer: a callable that implements L{logger.ILogObserver} or
    L{log.ILogObserver}.
Nc                t    VP                  RR4      V n        VP                  R4      ;'       g    RV n        R# )z5
Initialize an L{AppLogger} with a L{ServerOptions}.
r    r   N)r[   _logfilename_observerFactoryr   r^   s   &&r   r    AppLogger.__init__   s0     $KK	26 'H 5 = =r"   c                   V P                   e   V P                  4       pMDVP                  \        P                  R4      pVf!   VP                  \        P                  R4      pVf   V P                  4       pW n        \        P                  P                  V P                  4      '       d   V P                  .pM\        P                  P                  V P                  4      '       d#   \        P                  ! V P                  4      .pM>\        P                  ! R\        ^R7       \        P                  ! V P                  4      .p\        P                  P                  V4       V P                  4        R# )aK  
Initialize the global logging system for the given application.

If a custom logger was specified on the command line it will be used.
If not, and an L{logger.ILogObserver} or legacy L{log.ILogObserver}
component has been set on C{application}, then it will be used as the
log observer. Otherwise a log observer will be created based on the
command line options for built-in loggers (e.g. C{--logfile}).

@param application: The application on which to check for an
    L{logger.ILogObserver} or legacy L{log.ILogObserver}.
@type application: L{twisted.python.components.Componentized}
NaZ  Passing a logger factory which makes log observers which do not implement twisted.logger.ILogObserver or twisted.python.log.ILogObserver to twisted.application.app.AppLogger was deprecated in Twisted 16.2. Please use a factory that produces twisted.logger.ILogObserver (or the legacy twisted.python.log.ILogObserver) implementing objects instead.)
stacklevel)re   getComponentr   ILogObserverr   _getLogObserver	_observer
providedByLegacyLogObserverWrapperwarningswarnDeprecationWarningglobalLogBeginnerbeginLoggingTo_initialLog)r   applicationobserver	observerss   &&  r   startAppLogger.start   s      ,,,.H"//0C0CTJH&33C4D4DdK++-H!))$..99(I((8888HIIMM #  88HII  //	:r"   c                6   ^ RI Hp \        P                  ! V 4      P	                  R\
        P                  \        P                  \        P                  ! 4       R7       \        P                  ! V 4      P	                  R\        VP                  4      R7       R# )z!
Print twistd start log message.
rC   z1twistd {version} ({exe} {pyVersion}) starting up.)versionexe	pyVersionzreactor class: {reactor}.N)twisted.internetrC   r   
_loggerForinfor   r}   r>   
executabler   shortPythonVersionr   	__class__)r   rC   s   & r   ru   AppLogger._initialLog   st     	-$$$?%%002	 	% 	
 	$$$'g6G6G1H 	% 	
r"   c                    V P                   R8X  g   V P                   '       g   \        P                  pM)\        P                  P                  V P                   4      p\        P                  ! V4      # )zZ
Create a log observer to be added to the logging system before running
this application.
-)rd   r>   r?   r   LogFilefromFullPathr   textFileLogObserver)r   logFiles   & r   rl   AppLogger._getLogObserver   sQ    
 #4+<+<+<jjGoo2243D3DEG))'22r"   c                    \         P                  ! V 4      P                  R4       V P                  e3   \         P                  P                  V P                  4       RV n        R# R# )zC
Remove all log observers previously set up by L{AppLogger.start}.
zServer Shut Down.N)r   r   r   rm   globalLogPublisherremoveObserverr   s   &r   stopAppLogger.stop   sL     	$$$%89>>%%%44T^^D!DN &r"   )rd   rm   re   )r+   r,   r-   r.   r/   rm   r    ry   ru   rl   r   r0   r1   r2   s   @r   ra   ra      s0     " I>0d
 	3" "r"   ra   c                      R  p R pR pV\         P                  n        V \         P                  n        V\         P                  n        R# )c                     V P                  4        V P                  4        ^ RIHp VP	                  ^ VP
                  4       ^# )r   r|   )clear_all_breaksset_continuer   rC   	callLaterr   )r   argrC   s   && r   do_stopfixPdb.<locals>.do_stop   s4    ,!W\\*r"   c                     \        R 4       R# )zEstop - Continue execution, then cleanly shutdown the twisted reactor.N)printr   s   &r   	help_stopfixPdb.<locals>.help_stop   s    V	
r"   c                 2    \         P                  ! ^ 4       R# )r   N)os_exitr   s   &r   set_quitfixPdb.<locals>.set_quit  s    
r"   N)pdbPdbr   r   r   )r   r   r   s      r   fixPdbr      s6    

  CGGCGGO!CGGr"   c                   Vf   ^ RI Hp  V R,          '       d   Ve   VP                  V4       R# R# V R,          '       d   V\        n        V\        n        \        P                  R8X  dM   \        P                  ! \        P                  R 4       \        P                  ! \        P                  R 4       \        4        \        P                  ! VP                  4       R# VP                  4        R#   \         d    RpT R	,          '       d   TpM\        R
R4      pRp \         P"                  ! TR7       TP%                  4        T'       d   TP'                  4         R#  R#   T'       d   TP'                  4        i i ; ii ; i)a  
Start the reactor, using profiling if specified by the configuration, and
log any error happening in the process.

@param config: configuration of the twistd application.
@type config: L{ServerOptions}

@param oldstdout: initial value of C{sys.stdout}.
@type oldstdout: C{file}

@param oldstderr: initial value of C{sys.stderr}.
@type oldstderr: C{file}

@param profiler: object used to run the reactor with profiling.
@type profiler: L{AppProfiler}

@param reactor: The reactor to use.  If L{None}, the global reactor will
    be used.
Nr|   r7   debugposixc                  ,    \         P                  ! 4       # r   r   	set_traceargss   *r   <lambda>'runReactorWithLogging.<locals>.<lambda>+  s
    CMMOr"   c                  ,    \         P                  ! 4       # r   r   r   s   *r   r   r   ,  s
    3==?r"   FnodaemonzTWISTD-CRASH.logr8   Tfile)r   rC   r<   r>   r?   stderrr   platformTypesignalSIGUSR2SIGINTr   r   r;   BaseExceptionr@   	traceback	print_excflushrB   )config	oldstdout	oldstderrrZ   rC   rB   r   s   &&&&&  r   runReactorWithLoggingr     s   ( ,)#W% $G__"CJ"CJ##w.fnn.KLfmm-JKHKK$KKM *D*C0DE	T*JJL

 u

 s@   C8 C8 C8 B!C8 &C8 8F
F
&'E+F
+FF
c                 B    V '       d   \         P                   ! R 4      # R# )zPassphrase: N)getpassneededs   &r   getPassphraser   @  s    ~..r"   c                 B    V '       d   \         P                  ! R 4      # R# )zEncryption passphrase: N)r   getPasswordr   s   &r   getSavePassphraser   G  s     9::r"   c                   P   a  ] tR tRt o Rt]t]tR t	R t
R tR tR tR tR	tV tR
# )ApplicationRunneriN  a  
An object which helps running an application based on a config object.

Subclass me and implement preApplication and postApplication
methods. postApplication generally will want to run the reactor
after starting the application.

@ivar config: The config object, which provides a dict-like interface.

@ivar application: Available in postApplication, but not
   preApplication. This is the application object.

@ivar profilerFactory: Factory for creating a profiler object, able to
    profile the application if options are set accordingly.

@ivar profiler: Instance provided by C{profilerFactory}.

@ivar loggerFactory: Factory for creating object responsible for logging.

@ivar logger: Instance provided by C{loggerFactory}.
c                j    Wn         V P                  V4      V n        V P                  V4      V n        R # r   )r   profilerFactoryrZ   loggerFactoryr   )r   r   s   &&r   r    ApplicationRunner.__init__h  s+    ,,V4((0r"   c                    V P                  4        V P                  4       V n        V P                  P	                  V P                  4       V P                  4        V P                  P                  4        R# )z
Run the application.
N)preApplicationcreateOrGetApplicationrv   r   ry   postApplicationr   r   s   &r   r<   ApplicationRunner.runm  sU     	668$**+r"   c                    Vf   ^ RI Hp \        V P                  W#V P                  V4       \
        P                  ! V4      '       d   VP                  V n        R# RV n        R# )z
Run the reactor with the given configuration.  Subclasses should
probably call this from C{postApplication}.

@see: L{runReactorWithLogging}
Nr|   )r   rC   r   r   rZ   r   rn   _exitSignal)r   rC   r   r   s   &&&&r   startReactorApplicationRunner.startReactory  sJ     ?0dkk9PWX(33G<<&22D#Dr"   c                    \        4       h)zk
Override in subclass.

This should set up any state necessary before loading and
running the Application.
NotImplementedErrorr   s   &r   r    ApplicationRunner.preApplication  s     "##r"   c                    \        4       h)z
Override in subclass.

This will be called after the application has been loaded (so
the C{application} attribute will be set). Generally this
should start the application and run the reactor.
r   r   s   &r   r   !ApplicationRunner.postApplication  s     "##r"   c                   V P                   P                  '       d   V P                   P                  V P                   P                  ,          pVP                  V P                   P                  4      p\
        P                  ! VP                  4      pVP                  V4       V# \        V P                   R,          4      p\        V P                   V4      pV# )aM  
Create or load an Application based on the parameters found in the
given L{ServerOptions} instance.

If a subcommand was used, the L{service.IServiceMaker} that it
represents will be used to construct a service to be added to
a newly-created Application.

Otherwise, an application will be loaded based on parameters in
the config.
	encrypted)r   
subCommandloadedPluginsmakeService
subOptionsr   ApplicationtapnamesetServiceParentr   getApplication)r   plgserrv   
passphrases   &    r   r   (ApplicationRunner.createOrGetApplication  s     ;;!!! ++++DKK,B,BCC//$++"8"89C!--ckk:K  -  't{{;'?@J(jAKr"   )r   rv   r   r   rZ   N)r+   r,   r-   r.   r/   rV   r   ra   r   r    r<   r   r   r   r   r0   r1   r2   s   @r   r   r   N  s9     , "OM1

$ $$ r"   r   c                    R Uu. uF  q V,          '       g   K  W,          V3NK  	  up^ ,          pV^ ,          RR/P                  V^,          V^,          4      rT \        P                  ! RV,          4       \        P                  ! WEV4      p\        P                  ! R4       V# u upi   \
         d   pRT,          p\        T\        4      '       d"   TP                  ^ ,          R8X  d
   TR,          p\        P                  ! \        P                  R7       \        P                  ! T4       \        P                  ! 4        \        P                  ! R	T,           R	,           4        R
p?X# R
p?ii ; i)pythonr   picklezLoading %s...zLoaded.zFailed to load application: %srv   aN  
Could not find 'application' in the file. To use 'twistd -y', your .tac
file must create a suitable object (e.g., by calling service.Application())
and store it in a variable named 'application'. twistd loads your .tac file
and scans the global variables for one of this name.

Please read the 'Using Application' HOWTO for details.
r   
N)r   sourcer   )r[   r   msgr   loadApplication	Exception
isinstanceKeyErrorr   r   r   r   deferrr>   exit)r   r   tr(   filenamestylerv   r'   s   &&      r   r   r     s   !=K!=A&)Q!=KANAdVX.221Q41>e"(*+--hzJ	  + 	L  ",q0a""qvvayM'A  A 	-


D!!"s$   B)B)A
B. .E89B4E33E8c                      \         P                  ! \        P                  ! 4        U u. uF  q P                  NK  	  up 4      # u up i r   )r   CompleteListr   getReactorTypes	shortName)rs    r   _reactorActionr    s2    H4L4L4NO4Nq{{4NOPPOs   Ac                      a  ] tR tRt o Rt]P                  ! R]/R7      t]	P                  t]! ]P                  4      tR tR t]tRtV tR# )	ReactorSelectionMixini  z
Provides options for selecting a reactor to install.

If a reactor is installed, the short name which was used to locate it is
saved as the value for the C{"reactor"} key.
rC   )
optActionsc           	     t   \        V P                  4       \        R4      R7      pRpV FP  p \        VP                  4       V P
                  P                  RVP                  R RVP                   R24       KR  	  V'       dR   V P
                  P                  R4       V P
                  P                  R
4       V P
                  P                  V4       \        ^ 4      h  \         dL   pTRP                  TP                  TP                  TP                  ^ ,          4      ,          p R	p?EK	  R	p?ii ; i)z5
Display a list of possibly available reactor names.
r   keyrc   z    z<4	r   z    !{:<4}	{} ({})
Nz.    reactors not available on this platform:

)sorted_getReactorTypesr   r   
moduleNamemessageOutputwriter   descriptionr9   formatr   r%   )r   rctsnotWorkingReactorsr  r'   s   &    r   opt_help_reactors'ReactorSelectionMixin.opt_help_reactors  s    d++-:k3JKAALL)""((4B/?r!--PR)ST  $$T*$$E $$%78m  "&=&D&DKKMMFF1I' "s   AC!!D7,?D22D7c                     \        V4       WR&   R#   \         d    RT: R2p\        P                  ! T4      h\         d#   pRT: R2p\        P                  ! T4      hRp?ii ; i)zH
Which reactor to use (see --help-reactors for a list of possibilities)
rC   z'The specified reactor does not exist: 'z:'.
See the list of available reactors with --help-reactorsz9The specified reactor cannot be used, failed with error: z9.
See the list of available reactors with --help-reactorsN)r
   r	   r   
UsageErrorr   )r   r   r   r'   s   &&  r   opt_reactor!ReactorSelectionMixin.opt_reactor  sv    	(9%  (O  	( &/1 
 ""3'' 	( &') 
 ""3''	(s    0A'A'A""A'rG   N)r+   r,   r-   r.   r/   r   Completionsr  compDatar>   r?   r  staticmethodr   r   r  r  r  opt_rr0   r1   r2   s   @r   r  r    sL        Y,GHHJJM#H$<$<=2(8 Er"   r  c                     a  ] tR tRt o Rt. RO. RO. RO.t. RO. RO. RORRRRRP                  ]P                  4      ,          .. RO. RO. RO. R O.t	]
P                  ! R!.R]
P                  ! R4      R	]
P                  ! R4      R
]
P                  ! R4      R]
P                  ! 4       /R7      t]! ]P"                  4      tR tR t]tR tR"R ltR t]R 4       tRtV tR# )#ServerOptionsi  zQtwistd reads a twisted.application.service.Application out of a file and runs it.NrZ   rW   z!Name of the profiler to use (%s).z, r   r   r   rundirz*.tapz
*.(tac|py)z*.tas)mutuallyExclusiver  c                    R V R&   RV9   d   VR,          V n         M\        P                   V n         \        P                  P	                  V 4       R# )Fr   r?   N)r?   r>   r   Optionsr    )r   r8   kws   &*,r   r    ServerOptions.__init__X  s:    Wr>X,DK**DKt$r"   c                f    \         P                  ! R4       \        P                  ! 4        RV R&   R# )zh
Run the application in the Python Debugger (implies nodaemon),
sending SIGUSR2 will drop into debugger
Tr   N)r   setDebuggingr   startDebugModer   s   &r   	opt_debugServerOptions.opt_debug`  s'    
 	4  Wr"   c                    \         P                  ! \        P                  4        ^ RIpTP                  \        P                  4       R#   \
         d     R# i ; i)zs
Print an insanely verbose log of everything that happens.
Useful when debugging freezes or locks in complex code.
N)r>   settracer   spewer	threadingr9   )r   r-  s   & r   opt_spewServerOptions.opt_spewk  sD    
 	T[[!	 	4;;'  		s   A AAc                    Vf#   \         P                  R,          ;'       g    R.p\        P                  P	                  W4       R # )N:   NNz--help)r>   argvr   r"  parseOptionsrf   s   &&r   r3  ServerOptions.parseOptionsw  s0    ?hhrl00xjG""41r"   c                   V P                   '       g   V R ,          '       d   RV R&   V R,          e    \        V R,          4      V R&   R# R#   \         d3   p\        P                  ! RP                  T R,          T4      4      hRp?ii ; i)r   Tno_saver   Nz%Logger '{}' could not be imported: {})r   r   r   r   r  r  )r   r'   s   & r   postOptionsServerOptions.postOptions|  s|    ???d8nn"DO>%!)$x.!9X &  &&;BB4>STU s   A B	-BB	c              #    "   V P                  \        P                  4      p/ V n        \	        V\        R 4      R7       F;  pW P                  VP                  &   VP                  RV3R lVP                  3x  K=  	  R# 5i)r   r  Nc                 "    V P                  4       # r   )r^   )plugs   &r   r   +ServerOptions.subCommands.<locals>.<lambda>  s
    $,,.r"   )_getPluginsr   IServiceMakerr   r
  r   r   r  )r   pluginsr;  s   &  r   subCommandsServerOptions.subCommands  sp     ""7#8#897
9(=>D/3t||, !0    ?s   A>B )r   r?   )rY   NzBsave the Stats object rather than the text output of the profiler.)r6  ozdo not save state on shutdown)r   r'   z(The specified tap/aos file is encrypted.)r   lNz%log to a specified file, - for stdout)r   NNzA fully-qualified name to a log observer factory to use for the initial log observer.  Takes precedence over --logfile and --syslog (when available).)r7   rD   Nz7Run in profile mode, dumping results to specified file.)r   fz
twistd.tapzread the given .tap file)r   yNz:read an application from within a Python file (implies -o))r   r(   Nz2Read an application from a .tas file (AOT format).)r  d.z-Change to a supplied directory before running)r   r   r   r   )r+   r,   r-   r.   longdescoptFlagsjoinrV   r]   optParametersr   r  CompleteFilesCompleteDirsr  r  r   
getPluginsr=  r    r(  opt_br.  r3  r7  propertyr@  r0   r1   r2   s   @r   r  r    s    	! 	

 	:FH 	H	
	
 /$))K<Q<Q2RR		
 	@	
 	TM=MB   78E''0e)),7e))'2e((*	
H v001K% E
(2
	  r"   r  c                    V! 4       p VP                  4        V ! V4       R#   \        P                   dM   pR P                  \        P
                  R,          4      p\        T4       \        T RT 24        Rp?R# Rp?ii ; i) :r      Nr$   N)r3  r   errorrJ  r>   r2  r   )runAppr  r   uecommstrs   &&   r   r<   r<     sl    _F 	v ;; "((388C=)f	B4 !!"s   # BAA??Bc                     \         P                  ! WV4      p\        P                  ! V4      P	                  V4       \        V4      pV'       d   R p\        P                  ! V4      P                  W2R7       R # )N)r   r   )r   r   r   IPersistablesetStyler   save)fileintypeinr   fileouttypeoutencryptrv   s   &&&&&& r   convertStylera    s[    ))&*EK[!**73"7+J[!&&&Or"   c                 4   ^ RI Hp \        P                  ! V 4      P	                  4        V'       d5   \
        P                  ! V 4      pVP                  RRVP                  R4       VP                  RR\        P                  ! V 4      P                  4       R# )r   r|   aftershutdownbeforeN)
r   rC   r   IServicestartServicer   rY  addSystemEventTriggerr[  stopService)rv   r[  rC   rD   s   &&  r   startApplicationrj    sm    ([!..0[)%%gz166:N!!*g..{;GGr"   c                    \         P                   ! V \         P                  4       \        P                  ! \        P                  ! 4       V 4       R# )z
Force the application to terminate with the specified signal by replacing
the signal handler with the default and sending the signal to ourselves.

@param sig:  Signal to use to terminate the process with C{os.kill}.
@type sig:  C{int}
N)r   SIG_DFLr   killgetpid)sigs   &r   _exitWithSignalrp    s*     MM#v~~&GGBIIKr"   )NN)7r   r   r   r   r>   r   rp   operatorr   twistedr   r   r   twisted.applicationr   r   twisted.application.reactorsr	   r
   r   r   twisted.internet.interfacesr   twisted.persistedr   twisted.pythonr   r   r   r   r   r   twisted.python.reflectr   r   r   r   r5   rJ   rV   ra   r   r   r   r   r   r   r  r  r"  r  r<   ra  rj  rp  rG   r"   r   <module>ry     s     	 
  
    - - 1 G " E ! F F > > <N 6 ^  6L L,o" o"d",0fh hV2QB BJzEMM#8 zz	P		r"   