Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/web/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/web/__pycache__/tap.cpython-310.pyc
o

�b(�@s�dZddlZddlZddlZddlmZmZddlmZm	Z	ddl
mZmZm
Z
mZddlmZddlmZmZmZmZmZmZmZmZGdd	�d	ej�Zd
d�ZGdd
�d
ej�Zdd�ZdS)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@seZdZdZdZgd�gd�gd�gZgd�gd�gZe�dd	d
ej	j
fdg�eje�
d�e�
d
�e�
d
�d�d�ZdZdd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZeZdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZeZd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1S)2�OptionszB
    Define the options accepted by the I{twistd web} plugin.
    z
[web options])�logfile�lNz/Path to web CLF (Combined Log Format) log file.)�certificate�c�
server.pemz=(DEPRECATED: use --listen) SSL certificate to use for HTTPS. )�privkey�krz<(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-tracebacks�z�Show uncaught exceptions during rendering tracebacks to the client. WARNING: This may be a security risk and expose private data!�personalrzvInstead of generating a webserver, generate a ResourcePublisher which listens on  the port given by --listen, or ~/%s zif --listen is not specified.z*.logz*.pem)rrr)�
optActionsz�This 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.cCs@tj�|�g|d<d|d<g|d<g|d<d|d<|d<dS)N�indexes�root�extraHeaders�ports�port�https)r	r�__init__��self�r*�1/usr/lib/python3/dist-packages/twisted/web/tap.pyr'XszOptions.__init__c	C�6t�|jt�dddd��}tj|tdd�||d<dS)	zh
        (DEPRECATED: use --listen)
        Strports description of port to start the server on
        �Twisted��r���category�
stacklevelr%N)r�getDeprecationWarningString�opt_port�incremental�Version�warnings�warn�DeprecationWarning�r)r%�msgr*r*r+r5`�
�zOptions.opt_portc	Cr,)	zW
        (DEPRECATED: use --listen)
        Port to listen on for Secure HTTP.
        r-r.r/rr0r1r&N)rr4�	opt_httpsr6r7r8r9r:r;r*r*r+r>mr=zOptions.opt_httpscC�|d�|�dS)zi
        Add an strports description of port to start the server on.
        [default: tcp:8080]
        r$N��append)r)r%r*r*r+�
opt_listenx�zOptions.opt_listencCr?)zr
        Add the name of a file used to check for directory indexes.
        [default: index, index.html]
        r!Nr@)r)�	indexNamer*r*r+�	opt_indexrCzOptions.opt_indexcCst��|d<dS)zc
        Makes a server with ~/public_html and ~/.twistd-web-pb support for
        users.
        r"N)r�
UserDirectoryr(r*r*r+�opt_user�szOptions.opt_usercCs>t�tj�|��|d<tjtjd�|d_t	j
|djd<dS)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)rJr*r*r+�opt_path�s
�zOptions.opt_pathcCsBt|dtj�s
t�d��|�dd�\}}t�|�|dj|<dS)zh
        `ext=class' where `class' is added as a Processor for files ending
        with `ext'.
        r"z*You can only use --processor after --path.�=�N)	�
isinstancerrHr	�
UsageError�splitr�
namedClassrN)r)�proc�ext�klassr*r*r+�
opt_processor�s
zOptions.opt_processorcCst�|�}|�|d<dS)zN
        Create a Resource subclass with a zero-argument constructor.
        r"N)rrV)r)�	className�classObjr*r*r+�	opt_class�s
zOptions.opt_classcCst�|�|d<dS)zP
        An .rpy file to be used as the root resource of the webserver.
        r"N)r�ResourceScriptWrapper)r)�namer*r*r+�opt_resource_script�szOptions.opt_resource_scriptc	Cslzt�|�}Wnttfyt�d|����wt��}t�	|j
�t�dd|j�t
�t||�|d<dS)zo
        The FQPN of a WSGI application object to serve as the root resource of
        the webserver.
        zNo such WSGI application: �after�shutdownr"N)r�namedAny�AttributeError�
ValueErrorr	rTr�
ThreadPoolr�callWhenRunning�start�addSystemEventTrigger�stopr�WSGIResource)r)r_�application�poolr*r*r+�opt_wsgi�s�zOptions.opt_wsgicCs(t|dtj�s
t�d��||d_dS)zA
        Specify the default mime-type for static files.
        r"z*You can only use --mime_type after --path.N)rSrrHr	rT�defaultType)r)ror*r*r+�
opt_mime_type�s
zOptions.opt_mime_typecCs,t|dtj�s
t�d��|d�d�dS)zT
        Specify whether or not a request for 'foo' should return 'foo.ext'
        r"z1You can only use --allow_ignore_ext after --path.�*N�rSrrHr	rT�	ignoreExtr(r*r*r+�opt_allow_ignore_ext�s
�zOptions.opt_allow_ignore_extcCs,t|dtj�s
t�d��|d�|�dS)zT
        Specify an extension to ignore.  These will be processed in order.
        r"z+You can only use --ignore_ext after --path.Nrr)r)rXr*r*r+�opt_ignore_ext�s
zOptions.opt_ignore_extcCs.|�dd�\}}|d�|��|��f�dS)z
        Specify an additional header to be included in all responses. Specified
        as "HeaderName: HeaderValue".
        �:rRr#N)rUrA�strip)r)�headerr_�valuer*r*r+�opt_add_header�szOptions.opt_add_headercCs�|ddur|d�|d�|ddur=zt�d�Wnty(t�d��wd�|d|d|d	�}|d�|�t|d�d
krj|dratj	�
tj	�dtj
j��}|d�d
|�dS|d�d�dSdS)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&zOpenSSL.SSLzSSL support not installedz$ssl:port={}:privateKey={}:certKey={}rrrr�~zunix:ztcp:8080)rAr�namedModule�ImportErrorr	rT�format�lenrIrJ�
expanduser�joinrrF�userSocketName)r)�
sslStrportrJr*r*r+�postOptions�s,

����zOptions.postOptionsN)$�__name__�
__module__�__qualname__�__doc__�synopsis�
optParameters�optFlagsrArrFr�r	�Completions�
CompleteFiles�compData�longdescr'r5�opt_pr>rBrE�opt_irG�opt_urPrZr]r`rnrp�opt_mrtrurzr�r*r*r*r+rs^��������


rcCst�t�|��S)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)�siter*r*r+�makePersonalServerFactorysr�c@seZdZdd�Zdd�ZdS)�_AddHeadersResourcecCs||_||_dS�N)�_originalResource�_headers)r)�originalResource�headersr*r*r+r's
z_AddHeadersResource.__init__cCs,|jD]\}}|j�||�q|j�||�Sr�)r��responseHeaders�addRawHeaderr��getChildWithDefault)r)r_�requestr�vr*r*r+r�sz'_AddHeadersResource.getChildWithDefaultN)r�r�r�r'r�r*r*r*r+r�sr�c	Cst��}|dr|d}|dr|d|d_nt��}t|tj�r*|j�	t
j|�|dr5t||d�}|drCt
j||dd�}nt
�|�}|drOd|_|drgt�d	t�d
ddd
��}tj|tdd�|drot|�}|dD]
}t�||�}|�|�qs|S)Nr"r!r#r)�logPathrTrz--notracebacksr-��rr0r1rr$)r�MultiService�
indexNamesr�TestrSrrH�registry�setComponentr�IServiceCollectionr�r�Site�displayTracebacksr�_getDeprecationWarningStringr6r7r8r9r:r�r�setServiceParent)�config�sr"r�r<r%�svcr*r*r+�makeServices6�
�r�)r�rIr8r6�twisted.applicationrr�twisted.internetrr�twisted.pythonrrrr	�twisted.spreadr
�twisted.webrrr
rrrrrrr��Resourcer�r�r*r*r*r+�<module>s(s

Spamworldpro Mini