| Name | Size | Mode | Actions |
|---|---|---|---|
| test/ | - | 0755 | rm |
| _auth/ | - | 0755 | rm |
| __pycache__/ | - | 0755 | rm |
| client.py | 57971 | 0644 | editdlrm |
| demo.py | 516 | 0644 | editdlrm |
| distrib.py | 11863 | 0644 | editdlrm |
| domhelpers.py | 8806 | 0644 | editdlrm |
| error.py | 13028 | 0644 | editdlrm |
| guard.py | 587 | 0644 | editdlrm |
| html.py | 1543 | 0644 | editdlrm |
| http.py | 112360 | 0644 | editdlrm |
| http_headers.py | 8672 | 0644 | editdlrm |
| iweb.py | 27723 | 0644 | editdlrm |
| microdom.py | 36954 | 0644 | editdlrm |
| proxy.py | 9875 | 0644 | editdlrm |
| resource.py | 13573 | 0644 | editdlrm |
| rewrite.py | 1867 | 0644 | editdlrm |
| script.py | 5703 | 0644 | editdlrm |
| server.py | 29513 | 0644 | editdlrm |
| soap.py | 5230 | 0644 | editdlrm |
| static.py | 37284 | 0644 | editdlrm |
| sux.py | 20884 | 0644 | editdlrm |
| tap.py | 10262 | 0644 | editdlrm |
| template.py | 1302 | 0644 | editdlrm |
| twcgi.py | 11957 | 0644 | editdlrm |
| util.py | 749 | 0644 | editdlrm |
| vhost.py | 4503 | 0644 | editdlrm |
| wsgi.py | 21964 | 0644 | editdlrm |
| xmlrpc.py | 21148 | 0644 | editdlrm |
| _element.py | 5943 | 0644 | editdlrm |
| _flatten.py | 16592 | 0644 | editdlrm |
| _http2.py | 48761 | 0644 | editdlrm |
| _newclient.py | 63823 | 0644 | editdlrm |
| _responses.py | 3002 | 0644 | editdlrm |
| _stan.py | 10971 | 0644 | editdlrm |
| _template_util.py | 31496 | 0644 | editdlrm |
| __init__.py | 384 | 0644 | editdlrm |
/usr/lib/python3/dist-packages/twisted/web/script.py (5703B)
You forgot to assign to the variable "resource" in your script. For example:
# MyCoolWebApp.rpy import mygreatresource resource = mygreatresource.MyGreatResource()""" class AlreadyCached(Exception): """ This exception is raised when a path has already been cached. """ class CacheScanner: def __init__(self, path, registry): self.path = path self.registry = registry self.doCache = 0 def cache(self): c = self.registry.getCachedPath(self.path) if c is not None: raise AlreadyCached(c) self.recache() def recache(self): self.doCache = 1 noRsrc = resource.ErrorPage(500, "Whoops! Internal Error", rpyNoResource) def ResourceScript(path, registry): """ 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. """ cs = CacheScanner(path, registry) glob = { "__file__": _coerceToFilesystemEncoding("", path), "resource": noRsrc, "registry": registry, "cache": cs.cache, "recache": cs.recache, } try: execfile(path, glob, glob) except AlreadyCached as ac: return ac.args[0] rsrc = glob["resource"] if cs.doCache and rsrc is not noRsrc: registry.cachePath(path, rsrc) return rsrc def ResourceTemplate(path, registry): from quixote import ptl_compile # type: ignore[import] glob = { "__file__": _coerceToFilesystemEncoding("", path), "resource": resource.ErrorPage(500, "Whoops! Internal Error", rpyNoResource), "registry": registry, } with open(path) as f: # Not closed by quixote as of 2.9.1 e = ptl_compile.compile_template(f, path) code = compile(e, "