ó
    Ö›‘hpZ  ã                   óÐ  • S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
JrJr  S SKJrJr  S SKJrJr  S SKJr  S SKJr  S SKJr  S S	KJrJrJrJrJrJr  S S
K J!r!J"r"J#r#   " S S5      r$ " S S\$5      r% " S S\$5      r& " S S5      r' " S S5      r(S r)S%S jr*S r+S r, " S S5      r-S r.S r/ " S S5      r0 " S S \Rb                  \05      r2S! r3S" r4S# r5S$ r6g)&é    N)Ú
attrgetter)Ú	copyrightÚloggerÚplugin)ÚreactorsÚservice)ÚNoSuchReactorÚinstallReactor)Údefer)Ú_ISupportsExitSignalCapturing)Úsob)ÚfailureÚlogÚlogfileÚruntimeÚusageÚutil)ÚnamedAnyÚnamedModuleÚqualc                   ó$   • \ rS rSrSrS rS rSrg)Ú_BasicProfileré   zÝ
@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                 ó   • Xl         X l        g ©N©ÚprofileOutputÚ	saveStats)Úselfr   r   s      Ú[C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/application/app.pyÚ__init__Ú_BasicProfiler.__init__%   s   € Ø*ÔØ"�ó    c                 ó2   • SU SU 3nUS-  n[        U5      e)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   € ð ' v h¨b°°Ð4ˆØ	ð ñ 	ˆô ˜‹mÐr#   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   r*   Ú__static_attributes__© r#   r    r   r      s   † ñò#õr#   r   c                   ó   • \ rS rSrSrS rSrg)ÚProfileRunneré9   z)
Runner for the standard profile module.
c                 óL  •  SSK nWR                  5       nUR	                  UR
                  5        U R                  (       a  UR                  U R                  5        g[        R                  [        U R                  S5      sn[        l
         UR                  5         U[        R                  s[        l
        nUR                  5         g! [         a  nU R                  SU5         SnANçSnAff = f! U[        R                  s[        l
        nUR                  5         f = f)z*
Run reactor under the standard profiler.
r   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Ûð �O‰OÓˆØ	�	‰	�'—+‘+ÔØ�>�>Ø�L‰L˜×+Ñ+Õ,ä!Ÿj™j¬$¨t×/AÑ/AÀ3Ó*GˆOˆC””ðØ—‘”à"%¤s§z¡z�””
˜CØ—	‘	•øô ó 	2Ø×#Ñ# I¨q×1Ñ1ûð	2ûð #&¤s§z¡z�””
˜CØ—	‘	•ús#   ‚C ÂC5 Ã
C2ÃC-Ã-C2Ã5.D#r2   N©r,   r-   r.   r/   r0   r<   r1   r2   r#   r    r4   r4   9   s   † ñõr#   r4   c                   ó   • \ rS rSrSrS rSrg)ÚCProfileRunneréT   z!
Runner for the cProfile module.
c                 óø  •  SSK nSSKnWR	                  5       nUR                  UR                  5        U R                  (       a  UR                  U R                  5        g[        U R                  S5       nWR                  XVS9nUR                  5         UR                  S5        UR                  5         SSS5        g! [         a  nU R                  SU5         SnANÙSnAff = f! , (       d  f       g= f)z*
Run reactor under the cProfile profiler.
r   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ÛÛð ×ÑÓˆØ	�	‰	�'—+‘+ÔØ�>�>Ø�L‰L˜×+Ñ+Õ,ä�d×(Ñ(¨#Ô.°&Ø—L‘L �LÐ2�Ø—‘”Ø—‘˜RÔ Ø—‘”÷	 /Ð.øô ó 	3Ø×#Ñ# J°×2Ñ2ûð	3ú÷ /Õ.ús$   ‚C Á8AC+Ã
C(ÃC#Ã#C(Ã+
C9r2   NrG   r2   r#   r    rI   rI   T   s   † ñõ r#   rI   c                   ó(   • \ rS rSrSr\\S.rS rSr	g)ÚAppProfileréo   zš
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                 óZ  • UR                  SS5      nUR                  SS 5      nUR                  SS5      R                  5       U l        U R                  U R                  ;   a1  U R                  U R                     " X25      nUR                  U l        g [        SU R                   35      e)NÚ	savestatsFr7   ÚprofilerrX   zUnsupported profiler name: )ÚgetÚlowerr[   Ú	profilersr<   r&   )r   Úoptionsr   r   r[   s        r    r!   ÚAppProfiler.__init__z   s†   € Ø—K‘K ¨UÓ3ˆ	ØŸ™ I¨tÓ4ˆØŸ™ J°
Ó;×AÑAÓCˆŒØ�=‰=˜DŸN™NÓ*Ø—~‘~ d§m¡mÒ4°]ÓNˆHØ—|‘|ˆD�HäÐ:¸4¿=¹=¸/ÐJÓKÐKr#   )r[   r<   N)
r,   r-   r.   r/   r0   r4   rI   r^   r!   r1   r2   r#   r    rV   rV   o   s   † ñð *°~ÑF€IõLr#   rV   c                   ó:   • \ rS rSrSrSrS rS rS rS r	S r
S	rg)
Ú	AppLoggeré…   a-  
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                 óp   • UR                  SS5      U l        UR                  S5      =(       d    SU l        g)z5
Initialize an L{AppLogger} with a L{ServerOptions}.
r   Ú r   N)r\   Ú_logfilenameÚ_observerFactory©r   r_   s     r    r!   ÚAppLogger.__init__™   s-   € ð $ŸK™K¨	°2Ó6ˆÔØ '§¡¨HÓ 5× =¸ˆÕr#   c                 óä  • U R                   b  U R                  5       nOCUR                  [        R                  S5      nUc   UR                  [        R                  S5      nUc  U R                  5       nX l        [        R                  R                  U R                  5      (       a  U R                  /nO‹[        R                  R                  U R                  5      (       a"  [        R                  " U R                  5      /nO;[        R                  " S[        SS9  [        R                  " U R                  5      /n[        R                  R                  U5        U R                  5         g)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)rg   ÚgetComponentr   ÚILogObserverr   Ú_getLogObserverÚ	_observerÚ
providedByÚLegacyLogObserverWrapperÚwarningsÚwarnÚDeprecationWarningÚglobalLogBeginnerÚbeginLoggingToÚ_initialLog)r   ÚapplicationÚobserverÚ	observerss       r    ÚstartÚAppLogger.start    s  € ð × Ñ Ñ,Ø×,Ñ,Ó.‰Hà"×/Ñ/´×0CÑ0CÀTÓJˆHØÑà&×3Ñ3´C×4DÑ4DÀdÓK�àÑØ×+Ñ+Ó-ˆHØ!Œä×Ñ×)Ñ)¨$¯.©.×9Ñ9ØŸ™Ð(‰IÜ×Ñ×(Ñ(¨¯©×8Ñ8Ü×8Ò8¸¿¹ÓHÐI‰Iä�MŠMðô #Øòô  ×8Ò8¸¿¹ÓHÐIˆIä× Ñ ×/Ñ/°	Ô:Ø×ÑÕr#   c                 ó(  • SSK Jn  [        R                  " U 5      R	                  S[
        R                  [        R                  [        R                  " 5       S9  [        R                  " U 5      R	                  S[        UR                  5      S9  g)z!
Print twistd start log message.
r   ©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    rx   ÚAppLogger._initialLogÒ   st   € õ 	-ä×Ò˜$Ó×$Ñ$Ø?Ü×%Ñ%Ü—‘Ü×0Ò0Ó2ð	 	%ñ 	
ô 	×Ò˜$Ó×$Ñ$Ø'´°g×6GÑ6GÓ1Hð 	%ò 	
r#   c                 óä   • U R                   S:X  d  U R                   (       d  [        R                  nO)[        R                  R                  U R                   5      n[        R                  " U5      $ )zZ
Create a log observer to be added to the logging system before running
this application.
Ú-)rf   r>   r?   r   ÚLogFileÚfromFullPathr   ÚtextFileLogObserver)r   ÚlogFiles     r    ro   ÚAppLogger._getLogObserverâ   sN   € ð
 ×Ñ Ó#¨4×+<×+<Ü—j‘j‰Gä—o‘o×2Ñ2°4×3DÑ3DÓEˆGÜ×)Ò)¨'Ó2Ð2r#   c                 óÊ   • [         R                  " U 5      R                  S5        U R                  b1  [         R                  R                  U R                  5        SU l        gg)zC
Remove all log observers previously set up by L{AppLogger.start}.
zServer Shut Down.N)r   r„   r…   rp   ÚglobalLogPublisherÚremoveObserver©r   s    r    ÚstopÚAppLogger.stopí   sL   € ô 	×Ò˜$Ó×$Ñ$Ð%8Ô9Ø�>‰>Ñ%Ü×%Ñ%×4Ñ4°T·^±^ÔDØ!ˆD�Nð &r#   )rf   rp   rg   )r,   r-   r.   r/   r0   rp   r!   r|   rx   ro   r•   r1   r2   r#   r    rb   rb   …   s(   † ñð" €Iò>ò0òd
ò 	3õ"r#   rb   c                  ó”   • S n S nS nU[         R                  l        U [         R                  l        U[         R                  l        g )Nc                 óˆ   • U R                  5         U R                  5         SSKJn  UR	                  SUR
                  5        g)Nr   r   é   )Úclear_all_breaksÚset_continuerƒ   rC   Ú	callLaterr•   )r   ÚargrC   s      r    Údo_stopÚfixPdb.<locals>.do_stopø   s4   € Ø×ÑÔØ×ÑÔÝ,à×Ñ˜!˜WŸ\™\Ô*Ør#   c                 ó   • [        S5        g )NzEstop - Continue execution, then cleanly shutdown the twisted reactor.)Úprintr”   s    r    Ú	help_stopÚfixPdb.<locals>.help_stop   s   € ÜØVõ	
r#   c                 ó0   • [         R                  " S5        g )Nr   )ÚosÚ_exitr”   s    r    Úset_quitÚfixPdb.<locals>.set_quit  s   € Ü
�Š��r#   )ÚpdbÚPdbr§   rž   r¢   )rž   r¢   r§   s      r    ÚfixPdbr«   ÷   s6   € òò
ò
ð  „C‡G�GÔØ„C‡G�G„OØ!„C‡G�GÕr#   c                 óÞ  • Uc  SSK Jn   U S   (       a  Ub  UR                  U5        ggU S   (       a¡  U[        l        U[        l        [        R                  S:X  aL  [        R                  " [        R                  S 5        [        R                  " [        R                  S 5        [        5         [        R                  " UR                  5        gUR                  5         g! [         a{    S	nU S
   (       a  UnO[        SS5      nSn [         R"                  " US9  UR%                  5         U(       a  UR'                  5          g g! U(       a  UR'                  5         f f = ff = f)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   r   r7   ÚdebugÚposixc                  ó,   • [         R                  " 5       $ r   ©r©   Ú	set_trace©Úargss    r    Ú<lambda>Ú'runReactorWithLogging.<locals>.<lambda>+  s
   € ¼C¿MºM¼Or#   c                  ó,   • [         R                  " 5       $ 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Ú	oldstderrr[   rC   rB   r¹   s          r    ÚrunReactorWithLoggingrÆ     s	  € ð( �Ý,ðØ�)×ØÑ#Ø—‘˜WÕ%ð $à�G�_Ø"ŒCŒJØ"ŒCŒJÜ×#Ñ# wÓ.Ü—’œfŸn™nÑ.KÔLÜ—’œfŸm™mÑ-JÔKÜŒHÜ�KŠK˜Ÿ™Õ$à�K‰K�MøÜó ØˆØ�*×Ø‰DäÐ*¨CÓ0ˆDØˆEð	Ü×Ò TÒ*Ø�J‰JŒLæØ—
‘
–ñ øŽuØ—
‘
•ð úðús/   ‹C' «B*C' ÃC' Ã''E,Ä$EÄ3E,ÅE(Å(E,c                 ó>   • U (       a  [         R                   " S5      $ g )NzPassphrase: )Úgetpass©Úneededs    r    ÚgetPassphraserË   @  s   € ÞÜ�Š˜~Ó.Ð.àr#   c                 ó>   • U (       a  [         R                  " S5      $ g )NzEncryption passphrase: )r   ÚgetPasswordrÉ   s    r    ÚgetSavePassphraserÎ   G  s   € ÞÜ×ÒÐ 9Ó:Ð:àr#   c                   óD   • \ rS rSrSr\r\rS r	S r
S rS rS rS rS	rg
)Ú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                 óh   • Xl         U R                  U5      U l        U R                  U5      U l        g r   )rÃ   ÚprofilerFactoryr[   ÚloggerFactoryr   )r   rÃ   s     r    r!   ÚApplicationRunner.__init__h  s+   € ØŒØ×,Ñ,¨VÓ4ˆŒØ×(Ñ(¨Ó0ˆ�r#   c                 óì   • U R                  5         U R                  5       U l        U R                  R	                  U R                  5        U R                  5         U R                  R                  5         g)z
Run the application.
N)ÚpreApplicationÚcreateOrGetApplicationry   r   r|   ÚpostApplicationr•   r”   s    r    r<   ÚApplicationRunner.runm  sU   € ð 	×ÑÔØ×6Ñ6Ó8ˆÔà�‰×Ñ˜$×*Ñ*Ô+à×ÑÔØ�‰×ÑÕr#   c                 óÂ   • Uc  SSK Jn  [        U R                  X#U R                  U5        [
        R                  " U5      (       a  UR                  U l        gSU l        g)zŽ
Run the reactor with the given configuration.  Subclasses should
probably call this from C{postApplication}.

@see: L{runReactorWithLogging}
Nr   r   )rƒ   rC   rÆ   rÃ   r[   r   rq   Ú_exitSignal)r   rC   rÄ   rÅ   s       r    ÚstartReactorÚApplicationRunner.startReactory  sJ   € ð ‰?Ý0Ü˜dŸk™k¨9ÀÇÁÐPWÔXä(×3Ò3°G×<Ñ<Ø&×2Ñ2ˆDÕà#ˆDÕr#   c                 ó   • [        5       e)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                 ó   • [        5       e)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                 ó¢  • U R                   R                  (       a…  U R                   R                  U R                   R                     nUR                  U R                   R                  5      n[
        R                  " UR                  5      nUR                  U5        U$ [        U R                   S   5      n[        U R                   U5      nU$ )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Úserry   Ú
passphrases        r    r×   Ú(ApplicationRunner.createOrGetApplicationœ  sž   € ð �;‰;×!×!ð —+‘+×+Ñ+¨D¯K©K×,BÑ,BÑCˆCØ—/‘/ $§+¡+×"8Ñ"8Ó9ˆCÜ!×-Ò-¨c¯k©kÓ:ˆKØ× Ñ  Ô-ð Ðô ' t§{¡{°;Ñ'?Ó@ˆJÜ(¨¯©°jÓAˆKØÐr#   )rÛ   ry   rÃ   r   r[   N)r,   r-   r.   r/   r0   rV   rÒ   rb   rÓ   r!   r<   rÜ   rÖ   rØ   r×   r1   r2   r#   r    rÐ   rÐ   N  s1   † ñð, "€OØ€Mò1ò

ò$ò $ò$õr#   rÐ   c                 óŠ  • S Vs/ s H  o U   (       d  M  X   U4PM     snS   nUS   SS0R                  US   US   5      pT [        R                  " SU-  5        [        R                  " XEU5      n[        R                  " S5        U$ s  snf ! [
         a¦  nSU-  n[        U[        5      (       a  UR                  S   S	:X  a  US
-  n[        R                  " [        R                  S9  [        R                  " U5        [        R                  " 5         [        R                  " SU-   S-   5         S nAW$ S nAff = f)N)ÚpythonÚsourcer¹   r   r¹   Úpickler™   zLoading %s...zLoaded.zFailed to load application: %sry   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¸   Ú
)r\   r   Úmsgr   ÚloadApplicationÚ	ExceptionÚ
isinstanceÚKeyErrorr³   rÀ   rÁ   r   Údeferrr>   Úexit)rÃ   rð   Útr)   ÚfilenameÚstylery   r(   s           r    rí   rí   ¹  s  € Ù!=ÓKÒ!=˜AÈÅ‹ˆ&‰)�Q‹Ñ!=ÑKÈAÑN€AØ˜‘d˜V XÐ.×2Ñ2°1°Q±4¸¸1¹Ó>ˆeð"Ü�Š� (Ñ*Ô+Ü×-Ò-¨h¸zÓJˆÜ�Š�	Ôð  Ðùò+ 	Løô ó "Ø,¨qÑ0ˆÜ�aœ×"Ñ" q§v¡v¨a¡y°MÓ'AØð ñ ˆAô 	×Ò¤§¡Ò-Ü�Š�Œ
Ü�
Š
ŒÜ�Š�˜‘˜D‘×!Ð!ØÐûð"ús$   …B–
BÁAB Â
EÂBD=Ä=Ec                  ó’   • [         R                  " [        R                  " 5        V s/ s H  o R                  PM     sn 5      $ s  sn f r   )r   ÚCompleteListr   ÚgetReactorTypesÚ	shortName)Úrs    r    Ú_reactorActionr  Ò  s2   € Ü×Ò´H×4LÒ4LÔ4NÓOÒ4N¨qŸ{œ{Ñ4NÑOÓPÐPùÒOs   ¨Ac                   óˆ   • \ rS rSrSr\R                  " S\0S9r\	R                  r\" \R                  5      rS rS r\rSrg)	Ú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           	      óX  • [        U R                  5       [        S5      S9nSnU HP  n [        UR                  5        U R
                  R                  SUR                  S SUR                   S35        MR     U(       aQ  U R
                  R                  S5        U R
                  R                  S5        U R
                  R                  U5        [        S	5      e! [         aB  nUSR                  UR                  UR                  UR                  S	   5      -  n S
nAMþ  S
nAff = f)z5
Display a list of possibly available reactor names.
r  ©Úkeyre   z    z<4Ú	rö   z    !{:<4}	{} ({})
r   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×+Ñ+Ó-´:¸kÓ3JÑKˆØÐÛˆAðÜ˜AŸL™LÔ)Ø×"Ñ"×(Ñ(¨4°·±¸BÐ/?¸rÀ!Ç-Á-ÀÐPRÐ)SÖTñ ö Ø×Ñ×$Ñ$ TÔ*Ø×Ñ×$Ñ$ØEôð ×Ñ×$Ñ$Ð%7Ô8Ü˜‹mÐøô ó Ø"Ð&=×&DÑ&DØ—K‘KØ—M‘MØ—F‘F˜1‘Ió'ñ Ö"ûðús   ªACÃ
D)Ã'7D$Ä$D)c                 óÎ   •  [        U5        XS'   g! [         a    SU< S3n[        R                  " U5      e[         a"  nSU< S3n[        R                  " U5      eSnAff = f)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$r2   N)r,   r-   r.   r/   r0   r   ÚCompletionsr  ÚcompDatar>   r?   r  Ústaticmethodr   r  r  r  r  Úopt_rr1   r2   r#   r    r  r  Ö  sI   † ñð × Ò ¨Y¸Ð,GÑH€Hà—J‘J€MÙ# H×$<Ñ$<Ó=Ðòò2(ð8 ƒEr#   r  c            
       ó¤  • \ rS rSrSr/ SQ/ SQ/ SQ/r/ SQ/ SQ/ SQS	S
SSSR                  \R                  5      -  // SQ/ SQ/ SQ/ SQ/r	\
R                  " S/\
R                  " S5      \
R                  " S5      \
R                  " S5      \
R                  " 5       S.S9r\" \R"                  5      rS rS r\rS rSS jrS r\S 5       rSrg
) ÚServerOptionsi  zQtwistd reads a twisted.application.service.Application out of a file and runs it.)rZ   NzBsave the Stats object rather than the text output of the profiler.)Úno_saveÚ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   NNz•A 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[   NrX   z!Name of the profiler to use (%s).z, )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).)ÚrundirÚdÚ.z-Change to a supplied directory before running)r¹   ró   rô   z*.tapz
*.(tac|py)z*.tas)r¹   ró   rô   r(  )ÚmutuallyExclusiver	  c                 ó˜   • SU S'   SU;   a  US   U l         O[        R                   U l         [        R                  R	                  U 5        g )NFr­   r?   )r?   r>   r   ÚOptionsr!   )r   r8   Úkws      r    r!   ÚServerOptions.__init__X  s:   € ØˆˆW‰Ø�r‹>Ø˜X™,ˆD�KäŸ*™*ˆDŒKÜ�‰×Ñ˜tÕ$r#   c                 ód   • [         R                  " S5        [        R                  " 5         SU S'   g)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                 ó´   • [         R                  " [        R                  5         SSKnUR                  [        R                  5        g! [
         a     gf = f)zs
Print an insanely verbose log of everything that happens.
Useful when debugging freezes or locks in complex code.
r   N)r>   Úsettracer   ÚspewerÚ	threadingr9   )r   r8  s     r    Úopt_spewÚServerOptions.opt_spewk  sD   € ô
 	�Š”T—[‘[Ô!ð	Ûð 	×Ñœ4Ÿ;™;Õ'øô ó 	Ùð	ús   ¦A
 Á

AÁAc                 ó‚   • Uc  [         R                  SS  =(       d    S/n[        R                  R	                  X5        g )Nr™   z--help)r>   Úargvr   r-  ÚparseOptionsrh   s     r    r=  ÚServerOptions.parseOptionsw  s/   € Ø‰?Ü—h‘h˜q˜r�l×0 x jˆGÜ�‰×"Ñ" 4Õ1r#   c                 óì   • U R                   (       d
  U S   (       a  SU S'   U S   b   [        U S   5      U S'   g g ! [         a.  n[        R                  " SR                  U S   U5      5      eS nAff = f)Nró   Tr#  r   z%Logger '{}' could not be imported: {})ræ   r   rù   r   r  r  )r   r(   s     r    ÚpostOptionsÚServerOptions.postOptions|  sx   € Ø�?�?˜d 8ŸnØ"ˆD�‰OØ�‰>Ñ%ðÜ!)¨$¨x©.Ó!9��X’ð &øô ó Ü×&Ò&Ø;×BÑBÀ4ÈÁ>ÐSTÓUóð ûðús   ¨; »
A3Á)A.Á.A3c              #   óü   #   • U R                  [        R                  5      n0 U l        [	        U[        S5      S9 H;  nX R                  UR                  '   UR                  S U4S jUR                  4v •  M=     g 7f)Nrë   r  c                 ó"   • U R                  5       $ r   )r_   )Úplugs    r    r´   Ú+ServerOptions.subCommands.<locals>.<lambda>“  s
   €  $§,¡,¤.r#   )Ú_getPluginsr   ÚIServiceMakerrç   r  r   rë   r  )r   ÚpluginsrD  s      r    ÚsubCommandsÚServerOptions.subCommands‡  sp   é € à×"Ñ"¤7×#8Ñ#8Ó9ˆØˆÔÜ˜7¬
°9Ó(=Ô>ˆDØ/3×Ñ˜tŸ|™|Ñ,à—‘Øð !Ó0Ø× Ñ ðô ò ?ùs   ‚A:A<)rç   r?   r   )r,   r-   r.   r/   ÚlongdescÚoptFlagsÚjoinrV   r^   ÚoptParametersr   r  ÚCompleteFilesÚCompleteDirsr  r  r   Ú
getPluginsrF  r!   r3  Úopt_br9  r=  r@  ÚpropertyrI  r1   r2   r#   r    r"  r"    s  † ð	!ð ò	
ò
 	:ÚFð€Hò 	Hò	
ò	
ð ØØØ/°$·)±)¸K×<QÑ<QÓ2RÑRð		
ò 	@ò	
ò 	TÚMð=€MðB × Ò Ø7Ð8à×'Ò'¨Ó0Ø×)Ò)¨,Ó7Ø×)Ò)¨'Ó2Ø×(Ò(Ó*ñ	
ñ€Hñ ˜v×0Ñ0Ó1€Kò%òð €Eò
(ô2ò
	ð ñó ór#   r"  c                 ó   • U" 5       n UR                  5         U " U5        g ! [        R                   aG  nSR                  [        R
                  SS 5      n[        U5        [        U SU 35         S nAg S nAff = f)NÚ r   rk   r%   )r=  r   ÚerrorrM  r>   r<  r¡   )ÚrunAppr"  rÃ   ÚueÚcommstrs        r    r<   r<   ˜  sn   € Ù‹_€FðØ×ÑÔñ 	ˆv�øô �;‰;ó "Ø—(‘(œ3Ÿ8™8 A a˜=Ó)ˆÜˆfŒÜ��	˜˜B˜4Ð ×!Ñ!ûð"ús   ‰" ¢A=¶=A8Á8A=c                 óê   • [         R                  " XU5      n[        R                  " U5      R	                  U5        [        U5      nU(       a  S n[        R                  " U5      R                  X2S9  g )N)rÿ   rð   )r   rø   r   ÚIPersistableÚsetStylerÎ   Úsave)ÚfileinÚtypeinrð   ÚfileoutÚtypeoutÚencryptry   s          r    ÚconvertStylerc  ¤  s[   € Ü×)Ò)¨&¸*ÓE€KÜ×Ò�[Ó!×*Ñ*¨7Ô3Ü" 7Ó+€JÞØˆÜ×Ò�[Ó!×&Ñ&°Ð&ÒOr#   c                 ó0  • SSK Jn  [        R                  " U 5      R	                  5         U(       a4  [
        R                  " U 5      nUR                  SSUR                  S5        UR                  SS[        R                  " U 5      R                  5        g )Nr   r   ÚafterÚshutdownÚbefore)
rƒ   rC   r   ÚIServiceÚstartServicer   r[  ÚaddSystemEventTriggerr]  ÚstopService)ry   r]  rC   rD   s       r    ÚstartApplicationrl  ­  sm   € Ý(ä×Ò�[Ó!×.Ñ.Ô0ÞÜ×Ò˜[Ó)ˆØ×%Ñ% g¨z¸1¿6¹6À:ÔNØ×!Ñ!Ø�*œg×.Ò.¨{Ó;×GÑGõr#   c                 ó¢   • [         R                   " U [         R                  5        [        R                  " [        R                  " 5       U 5        g)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    Ú_exitWithSignalrr  ¹  s*   € ô ‡M‚M�#”v—~‘~Ô&Ü‡G‚GŒB�IŠI‹K˜Õr#   )NN)7rÈ   r¥   r©   r¼   r>   rÀ   rs   Ú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   r4   rI   rV   rb   r«   rÆ   rË   rÎ   rÐ   rí   r  r  r-  r"  r<   rc  rl  rr  r2   r#   r    Ú<module>r{     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�E—M‘MÐ#8ô zòz	òPò	ó	r#   