/usr/lib/python3/dist-packages/twisted/web/__pycache__
NameSizeModeActions
client.cpython-310.pyc578890644editdlrm
demo.cpython-310.pyc7750644editdlrm
distrib.cpython-310.pyc122830644editdlrm
domhelpers.cpython-310.pyc88800644editdlrm
error.cpython-310.pyc131210644editdlrm
guard.cpython-310.pyc5280644editdlrm
html.cpython-310.pyc16740644editdlrm
http.cpython-310.pyc966750644editdlrm
http_headers.cpython-310.pyc87120644editdlrm
iweb.cpython-310.pyc313510644editdlrm
microdom.cpython-310.pyc302510644editdlrm
proxy.cpython-310.pyc100340644editdlrm
resource.cpython-310.pyc151370644editdlrm
rewrite.cpython-310.pyc22660644editdlrm
script.cpython-310.pyc64210644editdlrm
server.cpython-310.pyc259950644editdlrm
soap.cpython-310.pyc45010644editdlrm
static.cpython-310.pyc329660644editdlrm
sux.cpython-310.pyc169110644editdlrm
tap.cpython-310.pyc100280644editdlrm
template.cpython-310.pyc12190644editdlrm
twcgi.cpython-310.pyc102500644editdlrm
util.cpython-310.pyc6090644editdlrm
vhost.cpython-310.pyc57850644editdlrm
wsgi.cpython-310.pyc161300644editdlrm
xmlrpc.cpython-310.pyc200150644editdlrm
_element.cpython-310.pyc63360644editdlrm
_flatten.cpython-310.pyc145810644editdlrm
_http2.cpython-310.pyc378270644editdlrm
_newclient.cpython-310.pyc527690644editdlrm
_responses.cpython-310.pyc27210644editdlrm
_stan.cpython-310.pyc88560644editdlrm
_template_util.cpython-310.pyc304340644editdlrm
__init__.cpython-310.pyc4230644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/web/__pycache__/script.cpython-310.pyc (6421B)
o bG@sdZddlZddlZddlmZddlmZddlmZm Z ddl m Z ddl m Z mZmZmZmZdZGd d d eZGd d d Zed deZddZddZGdddejZGdddejZGdddejZdS)zH I contain PythonScript, which is a very simple python script resource. N)StringIO) copyright)execfile networkString)_coerceToFilesystemEncoding)httpresourceserverstaticutilz

You forgot to assign to the variable "resource" in your script. For example:

# MyCoolWebApp.rpy

import mygreatresource

resource = mygreatresource.MyGreatResource()
c@seZdZdZdS) AlreadyCachedzG This exception is raised when a path has already been cached. N)__name__ __module__ __qualname____doc__rr4/usr/lib/python3/dist-packages/twisted/web/script.pyr sr c@s$eZdZddZddZddZdS) CacheScannercCs||_||_d|_dS)Nr)pathregistrydoCacheselfrrrrr__init__%s zCacheScanner.__init__cCs*|j|j}|durt||dSN)r getCachedPathrr recache)rcrrrcache*s zCacheScanner.cachecCs d|_dS)N)r)rrrrr0s zCacheScanner.recacheN)r rrrrrrrrrr$s rWhoops! Internal Errorc Cst||}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) rrnoRsrcrrrr argsr cachePath)rrcsglobacrsrcrrrResourceScript7s"  r+cCs|ddlm}td|tddt|d}t|}|||}Wdn1s)wYt|dd}t ||||d S) Nr) ptl_compiler"r r!)r#rrzexecr) quixoter,rr ErrorPage rpyNoResourceopencompile_templatecompileeval)rrr,r(fecoderrrResourceTemplateOs     r8c@s&eZdZdddZddZddZdS) ResourceScriptWrapperNcC$tj|||_|pt|_dSrrResourcerrr Registryrrrrrr` zResourceScriptWrapper.__init__cCst|j|j}||Sr)r+rrrender)rrequestresrrrr?es zResourceScriptWrapper.rendercCst|j|j}|||Sr)r+rrgetChildWithDefault)rrr@rArrrrBis z)ResourceScriptWrapper.getChildWithDefaultr)r rrrr?rBrrrrr9_s  r9c@s*eZdZdZd ddZddZddZdS) 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;)rpathnamerrrrr|r>z ResourceScriptDirectory.__init__cCsHtj|j|}tj|rt||jStj|r t||jSt Sr) osrjoinisdirrCrexistsr+r NoResource)rrr@fnrrrgetChilds     z ResourceScriptDirectory.getChildcCst|Sr)rrIr?)rr@rrrr?szResourceScriptDirectory.renderr)r rrrrrKr?rrrrrCns   rCc@s$eZdZdZdZddZddZdS) 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)rrMrrrrrs zPythonScript.__init__c Cs|dtdtj|td|j|jd}z t|j||WnJtyG}z|j dkr=| t j | td|WYd}~n'd}~wtyit}tj|dt|}|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#rzFile not found.N)fileutf8) setHeaderrrversionrrMrrOSErrorerrnosetResponseCoder NOT_FOUNDwriterrIr? BaseExceptionr traceback print_excr _PREgetvalueencodefinishr NOT_DONE_YET)rr@ namespacer6iooutputrrrr?s.       zPythonScript.renderN)r rrrisLeafrr?rrrrrLs  rL)rrErYrartwistedrtwisted.python.compatrrtwisted.python.filepathr twisted.webrrr r r r0 Exceptionr rr/r$r+r8r<r9rCrLrrrrs"