+
    Dfj(                         R t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHtH	t	 ^ RI
HtHtHtHt ^ RIHt ^ RIHtHtHtHtHtHtHtHt  ! R R]P4                  4      tR	 t ! R
 R]P8                  4      tR tR# )z9
Support for creating a service which runs a web server.
N)servicestrports)
interfacesreactor)	deprecatereflect
threadpoolusage)pb)demodistribresourcescriptserverstatictwcgiwsgic            
         a  ] tR t^t o RtRt. R!O. R"O. R#O.t. R$O. R%O.t]P                  RRR	]	P                  P                  : R
2R,           .4       ]P                  ! R]P                  ! R4      R]P                  ! R4      R]P                  ! R4      /R7      tRtR tR t]tR tR tR t]tR t]tR tR tR tR tR tR t]t R t!R t"R t#R t$R t%V t&R# )&Optionsz:
Define the options accepted by the I{twistd web} plugin.
z[web options]logfileNcertificateprivkey personalzsInstead of generating a webserver, generate a ResourcePublisher which listens on  the port given by --listen, or ~/ zif --listen is not specified.z*.logz*.pem)
optActionszThis starts a webserver.  If you specify no arguments, it will be a
demo webserver that has the Test class from twisted.web.demo in it.c                    \         P                  P                  V 4       . V R &   RV R&   . V R&   . V R&   R;V R&   V R&   R# )indexesNrootextraHeadersportsporthttps)r	   r   __init__selfs   &1/usr/lib/python3/dist-packages/twisted/web/tap.pyr#   Options.__init__X   sK    t$YV!^W'++VtG}    c           	         \         P                  ! V P                  \        P                  ! R^^^ 4      4      p\
        P                  ! V\        ^R7       WR&   R# )zP
(DEPRECATED: use --listen)
Strports description of port to start the server on
Twistedcategory
stacklevelr!   N)r   getDeprecationWarningStringopt_portincrementalVersionwarningswarnDeprecationWarningr%   r!   msgs   && r&   r/   Options.opt_port`   sH    
 33MM;..y"aC
 	c$61EVr(   c           	         \         P                  ! V P                  \        P                  ! R^^^ 4      4      p\
        P                  ! V\        ^R7       WR&   R# )z?
(DEPRECATED: use --listen)
Port to listen on for Secure HTTP.
r*   r+   r"   N)r   r.   	opt_httpsr0   r1   r2   r3   r4   r5   s   && r&   r9   Options.opt_httpsm   sH    
 33NNK//	2q!D
 	c$61EWr(   c                6    V R,          P                  V4       R# )zQ
Add an strports description of port to start the server on.
[default: tcp:8080]
r    Nappend)r%   r!   s   &&r&   
opt_listenOptions.opt_listenx   s    
 	WT"r(   c                6    V R,          P                  V4       R# )zZ
Add the name of a file used to check for directory indexes.
[default: index, index.html]
r   Nr<   )r%   	indexNames   &&r&   	opt_indexOptions.opt_index   s    
 	Yy)r(   c                6    \         P                  ! 4       V R&   R# )zK
Makes a server with ~/public_html and ~/.twistd-web-pb support for
users.
r   N)r   UserDirectoryr$   s   &r&   opt_userOptions.opt_user   s    
 ,,.Vr(   c                   \         P                  ! \        P                  P	                  V4      4      V R&   R\
        P                  R\
        P                  /V R,          n        \        P                  V R,          P                  R&   R# )z
<path> is either a specific file or a directory to be set as the root
of the web server. Use this if you have a directory full of HTML, cgi,
epy, or rpy files or any other files that you want to be served up raw.
r   z.epyz.rpyz.cgiN)r   Fileospathabspathr   PythonScriptResourceScript
processorsr   	CGIScript)r%   rK   s   &&r&   opt_pathOptions.opt_path   sa     {{277??4#89VF''F))#
V +0//V'r(   c                    \        V R,          \        P                  4      '       g   \        P                  ! R4      hVP                  R^4      w  r#\        P                  ! V4      V R,          P                  V&   R# )zP
`ext=class' where `class' is added as a Processor for files ending
with `ext'.
r   z*You can only use --processor after --path.=N)	
isinstancer   rI   r	   
UsageErrorsplitr   
namedClassrO   )r%   procextklasss   &&  r&   opt_processorOptions.opt_processor   s\    
 $v,44""#OPPZZQ'
'.'9'9%'@V$r(   c                F    \         P                  ! V4      pV! 4       V R&   R# )z>
Create a Resource subclass with a zero-argument constructor.
r   N)r   rX   )r%   	classNameclassObjs   && r&   	opt_classOptions.opt_class   s     %%i0zVr(   c                8    \         P                  ! V4      V R&   R# )z@
An .rpy file to be used as the root resource of the webserver.
r   N)r   ResourceScriptWrapper)r%   names   &&r&   opt_resource_scriptOptions.opt_resource_script   s     33D9Vr(   c                |    \         P                  ! V4      p\        P                  ! 4       p\        P                  ! TP                  4       \        P                  ! RRTP                  4       \        P                  ! \        Y24      T R&   R#   \        \        3 d    \        P
                  ! RT: 24      hi ; i)zW
The FQPN of a WSGI application object to serve as the root resource of
the webserver.
zNo such WSGI application: aftershutdownr   N)r   namedAnyAttributeError
ValueErrorr	   rV   r   
ThreadPoolr   callWhenRunningstartaddSystemEventTriggerstopr   WSGIResource)r%   re   applicationpools   &&  r&   opt_wsgiOptions.opt_wsgi   s    
	J!**40K $$&

+%%gz499E(($DV 
+ 	J""%?x#HII	Js   B ,B;c                    \        V R,          \        P                  4      '       g   \        P                  ! R4      hWR,          n        R# )z1
Specify the default mime-type for static files.
r   z*You can only use --mime_type after --path.N)rU   r   rI   r	   rV   defaultType)r%   ry   s   &&r&   opt_mime_typeOptions.opt_mime_type   s5     $v,44""#OPP#.V r(   c                    \        V R,          \        P                  4      '       g   \        P                  ! R4      hV R,          P                  R4       R# )zD
Specify whether or not a request for 'foo' should return 'foo.ext'
r   z1You can only use --allow_ignore_ext after --path.*NrU   r   rI   r	   rV   	ignoreExtr$   s   &r&   opt_allow_ignore_extOptions.opt_allow_ignore_ext   sC     $v,44""F  	Vs#r(   c                    \        V R,          \        P                  4      '       g   \        P                  ! R4      hV R,          P                  V4       R# )zD
Specify an extension to ignore.  These will be processed in order.
r   z+You can only use --ignore_ext after --path.Nr~   )r%   rZ   s   &&r&   opt_ignore_extOptions.opt_ignore_ext   s=     $v,44""#STTVs#r(   c                    VP                  R^4      w  r#V R,          P                  VP                  4       VP                  4       34       R# )zg
Specify an additional header to be included in all responses. Specified
as "HeaderName: HeaderValue".
:r   N)rW   r=   strip)r%   headerre   values   &&  r&   opt_add_headerOptions.opt_add_header   s:    
 ll3*^##TZZ\5;;=$ABr(   c                   V R,          e    V R,          P                  V R,          4       V R,          eX    \        P                  ! R4       RP                  T R,          T R,          T R	,          4      pT R,          P                  T4       \        V R,          4      ^ 8X  d   V R
,          '       dw   \        P                  P                  \        P                  P                  R\        P                  P                  4      4      pV R,          P                  RV,           4       R# V R,          P                  R4       R# R#   \         d    \        P
                  ! R4      hi ; i)a  
Set up conditional defaults and check for dependencies.

If SSL is not available but an HTTPS server was configured, raise a
L{UsageError} indicating that this is not possible.

If no server port was supplied, select a default appropriate for the
other options supplied.
r!   Nr    r"   zOpenSSL.SSLzSSL support not installedz$ssl:port={}:privateKey={}:certKey={}r   r   r   ~zunix:ztcp:8080)r=   r   namedModuleImportErrorr	   rV   formatlenrJ   rK   
expanduserjoinr   rE   userSocketName)r%   
sslStrportrK   s   &  r&   postOptionsOptions.postOptions   s!    <#M  f.=$D##M2 @FFWY]#J
 M  ,tG}"Jww))GGLLg&;&;&J&JK W$$Wt^4W$$Z0 #  D&&'BCCDs   E "E' )r   lNz/Path to web CLF (Combined Log Format) log file.)r   c
server.pemz=(DEPRECATED: use --listen) SSL certificate to use for HTTPS. )r   kr   z<(DEPRECATED: use --listen) SSL certificate to use for HTTPS.)notracebacksnzY(DEPRECATED: Tracebacks are disabled by default. See --enable-tracebacks to turn them on.)display-tracebacksr   zShow uncaught exceptions during rendering tracebacks to the client. WARNING: This may be a security risk and expose private data!)'__name__
__module____qualname____firstlineno____doc__synopsisoptParametersoptFlagsr=   r   rE   r   r	   CompletionsCompleteFilescompDatalongdescr#   r/   opt_pr9   r>   rB   opt_irF   opt_urQ   r\   ra   rf   rv   rz   opt_mr   r   r   r   __static_attributes____classdictcell____classdict__s   @r&   r   r      s6     H 	R	
	
M"	
	
H( OO %,$9$9$H$HK ..	
	   u**735..w7u**73
HGH,	 E	#* E/ E:A":E/ E$$C1 1r(   r   c                V    \         P                  ! \        P                  ! V 4      4      # )z
Create and return a factory which will respond to I{distrib} requests
against the given site.

@type site: L{twisted.web.server.Site}
@rtype: L{twisted.internet.protocol.Factory}
)r
   PBServerFactoryr   ResourcePublisher)sites   &r&   makePersonalServerFactoryr     s      g77=>>r(   c                   ,   a  ] tR tRt o R tR tRtV tR# )_AddHeadersResourcei  c                    Wn         W n        R # N)_originalResource_headers)r%   originalResourceheaderss   &&&r&   r#   _AddHeadersResource.__init__  s    !1r(   c                    V P                    F   w  r4VP                  P                  W44       K"  	  V P                  P	                  W4      # r   )r   responseHeadersaddRawHeaderr   getChildWithDefault)r%   re   requestr   vs   &&&  r&   r   '_AddHeadersResource.getChildWithDefault  s=    MMDA##006 "%%99$HHr(   )r   r   N)r   r   r   r   r#   r   r   r   r   s   @r&   r   r     s      I Ir(   r   c           	         \         P                  ! 4       pV R ,          '       d/   V R ,          pV R,          '       d   V R,          V R ,          n        M\        P                  ! 4       p\        V\        P                  4      '       d+   VP                  P                  \        P                  V4       V R,          '       d   \        W R,          4      pV R,          '       d    \        P                  ! W R,          R7      pM\        P                  ! V4      pV R,          '       d   RVn        V R,          '       dL   \         P"                  ! R\$        P&                  ! R	^^^ 4      4      p\(        P*                  ! V\,        ^R
7       V R,          '       d   \/        V4      pV R,           F*  p\0        P                   ! WS4      pVP3                  V4       K,  	  V# )r   r   r   r   )logPathr   Tr   z--notracebacksr*   r+   r   r    )r   MultiService
indexNamesr   TestrU   r   rI   registrysetComponentr   IServiceCollectionr   r   SitedisplayTracebacksr   _getDeprecationWarningStringr0   r1   r2   r3   r4   r   r   setServiceParent)configsr   r   r6   r!   svcs   &      r&   makeServicer     sa   Af~~f~)(.y(9F6N% yy{$$$"":#@#@!Dn"4)?@i{{4	):;{{4 "##!% n44k11)RAF
 	c$61Ej(.wt*Q   Hr(   )r   rJ   r2   r0   twisted.applicationr   r   twisted.internetr   r   twisted.pythonr   r   r   r	   twisted.spreadr
   twisted.webr   r   r   r   r   r   r   r   r   r   Resourcer   r   r   r(   r&   <module>r      s^   

 
   1 0 @ @  T T To1emm o1d?I(++ I$r(   