| Name | Size | Mode | Actions |
|---|---|---|---|
| test/ | - | 0755 | rm |
| _auth/ | - | 0755 | rm |
| __pycache__/ | - | 0755 | rm |
| client.py | 76062 | 0644 | editdlrm |
| demo.py | 554 | 0644 | editdlrm |
| distrib.py | 11877 | 0644 | editdlrm |
| domhelpers.py | 8645 | 0644 | editdlrm |
| error.py | 12764 | 0644 | editdlrm |
| guard.py | 630 | 0644 | editdlrm |
| html.py | 1557 | 0644 | editdlrm |
| http.py | 104634 | 0644 | editdlrm |
| http_headers.py | 8231 | 0644 | editdlrm |
| iweb.py | 25571 | 0644 | editdlrm |
| microdom.py | 36197 | 0644 | editdlrm |
| proxy.py | 9835 | 0644 | editdlrm |
| resource.py | 13108 | 0644 | editdlrm |
| rewrite.py | 1852 | 0644 | editdlrm |
| script.py | 5745 | 0644 | editdlrm |
| server.py | 27509 | 0644 | editdlrm |
| static.py | 38007 | 0644 | editdlrm |
| sux.py | 20892 | 0644 | editdlrm |
| tap.py | 9846 | 0644 | editdlrm |
| template.py | 17631 | 0644 | editdlrm |
| twcgi.py | 11343 | 0644 | editdlrm |
| util.py | 12452 | 0644 | editdlrm |
| vhost.py | 4587 | 0644 | editdlrm |
| wsgi.py | 21879 | 0644 | editdlrm |
| xmlrpc.py | 20203 | 0644 | editdlrm |
| _element.py | 5947 | 0644 | editdlrm |
| _flatten.py | 15912 | 0644 | editdlrm |
| _http2.py | 49186 | 0644 | editdlrm |
| _newclient.py | 63973 | 0644 | editdlrm |
| _responses.py | 3655 | 0644 | editdlrm |
| _stan.py | 10790 | 0644 | editdlrm |
| __init__.py | 699 | 0644 | editdlrm |
/usr/lib/python3/dist-packages/twisted/web/script.py (5745B)
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 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, "