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__/script.cpython-310.pyc
o

�bG�@s�dZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
mZmZmZmZdZGd	d
�d
e�ZGdd�d�Ze�d
de�Zdd�Zdd�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZdS)zH
I contain PythonScript, which is a very simple python script resource.
�N)�StringIO)�	copyright)�execfile�
networkString)�_coerceToFilesystemEncoding)�http�resource�server�static�utilz�<p>You forgot to assign to the variable "resource" in your script. For example:</p>
<pre>
# MyCoolWebApp.rpy

import mygreatresource

resource = mygreatresource.MyGreatResource()
</pre>
c@seZdZdZdS)�
AlreadyCachedzG
    This exception is raised when a path has already been cached.
    N)�__name__�
__module__�__qualname__�__doc__�rr�4/usr/lib/python3/dist-packages/twisted/web/script.pyrsrc@s$eZdZdd�Zdd�Zdd�ZdS)�CacheScannercCs||_||_d|_dS)Nr)�path�registry�doCache��selfrrrrr�__init__%s
zCacheScanner.__init__cCs*|j�|j�}|durt|��|��dS�N)r�
getCachedPathrr�recache)r�crrr�cache*szCacheScanner.cachecCs
d|_dS)N�)r)rrrrr0s
zCacheScanner.recacheN)r
rrrrrrrrrr$sr���Whoops! Internal Errorc
Cs�t||�}td|�t||j|jd�}zt|||�Wnty1}z|jdWYd}~Sd}~ww|d}|jrC|turC|�	||�|S)z�
    I am a normal py file which must define a 'resource' global, which should
    be an instance of (a subclass of) web.resource.Resource; it will be
    renderred.
    �)�__file__rrrrrNr)
rr�noRsrcrrrr�argsr�	cachePath)rr�cs�glob�ac�rsrcrrr�ResourceScript7s"
���r+cCs|ddlm}td|�t�ddt�|d�}t|��}|�||�}Wd�n1s)wYt|dd�}t	|||�|d	S)
Nr)�ptl_compiler"r r!)r#rrz<source>�execr)
�quixoter,rr�	ErrorPage�
rpyNoResource�open�compile_template�compile�eval)rrr,r(�f�e�coderrr�ResourceTemplateOs�
�r8c@s&eZdZddd�Zdd�Zdd�ZdS)	�ResourceScriptWrapperNcC�$tj�|�||_|pt��|_dSr�r�Resourcerrr
�Registryrrrrrr`�zResourceScriptWrapper.__init__cCst|j|j�}|�|�Sr)r+rr�render)r�request�resrrrr?es
zResourceScriptWrapper.rendercCst|j|j�}|�||�Sr)r+rr�getChildWithDefault)rrr@rArrrrBisz)ResourceScriptWrapper.getChildWithDefaultr)r
rrrr?rBrrrrr9_s
r9c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
�ResourceScriptDirectorya
    L{ResourceScriptDirectory} is a resource which serves scripts from a
    filesystem directory.  File children of a L{ResourceScriptDirectory} will
    be served using L{ResourceScript}.  Directory children will be served using
    another L{ResourceScriptDirectory}.

    @ivar path: A C{str} giving the filesystem path in which children will be
        looked up.

    @ivar registry: A L{static.Registry} instance which will be used to decide
        how to interpret scripts found as children of this resource.
    NcCr:rr;)r�pathnamerrrrr|r>z ResourceScriptDirectory.__init__cCsHtj�|j|�}tj�|�rt||j�Stj�|�r t||j�St�	�Sr)
�osr�join�isdirrCr�existsr+r�
NoResource)rrr@�fnrrr�getChild�sz ResourceScriptDirectory.getChildcCst���|�Sr)rrIr?)rr@rrrr?�szResourceScriptDirectory.renderr)r
rrrrrKr?rrrrrCns


	rCc@s$eZdZdZdZdd�Zdd�ZdS)�PythonScriptz�
    I am an extremely simple dynamic resource; an embedded python script.

    This will execute a file (usually of the extension '.epy') as Python code,
    internal to the webserver.
    TcCs||_||_dS)z3
        Initialize me with a script name.
        N)�filenamer)rrMrrrrr�s
zPythonScript.__init__c
Cs�|�dtdtj��|td|j�|jd�}z	t|j||�WnJtyG}z|j	dkr=|�
tj�|�
t�d��|��WYd}~n'd}~wtyit�}tj|d�t�|���}|�d	�}|�
|�Ynw|��tjS)
a4
        Render me to a web client.

        Load my file, execute it in a special namespace (with 'request' and
        '__file__' global vars) and finish the request.  Output to the web-page
        will NOT be handled with print - standard output goes to the log - but
        with request.write.
        sx-powered-byz
Twisted/%sr")r@r#r�zFile not found.N)�file�utf8)�	setHeaderrr�versionrrMrr�OSError�errno�setResponseCoder�	NOT_FOUND�writerrIr?�
BaseExceptionr�	traceback�	print_excr�_PRE�getvalue�encode�finishr	�NOT_DONE_YET)rr@�	namespacer6�io�outputrrrr?�s.	�
�
�
�zPythonScript.renderN)r
rrr�isLeafrr?rrrrrL�s
rL)rrErYrar�twistedr�twisted.python.compatrr�twisted.python.filepathr�twisted.webrrr	r
rr0�	Exceptionrrr/r$r+r8r<r9rCrLrrrr�<module>s" 

Spamworldpro Mini