summaryrefslogtreecommitdiff
path: root/src/mailman/rest/urls.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-05-10 16:13:02 -0400
committerBarry Warsaw2009-05-10 16:13:02 -0400
commite230b909d444f0fa9ed3d4f847deeb6be0808336 (patch)
treefa51063da700d3ed63c8a4cd39b9b5ec6a3d5154 /src/mailman/rest/urls.py
parent374fbfef115c54f354b1fa823f0feef5c22c9d38 (diff)
downloadmailman-e230b909d444f0fa9ed3d4f847deeb6be0808336.tar.gz
mailman-e230b909d444f0fa9ed3d4f847deeb6be0808336.tar.zst
mailman-e230b909d444f0fa9ed3d4f847deeb6be0808336.zip
More tests for the REST server, this time, for the queue runner.
Add logging to the RESTRunner. Also, use pkg_resources.resource_stream() instead of .resource_string() where appropriate. Add a bunch of XXX comments for things I need to figure out about the Zope-ish parts of the lazr.restful implementation. Change __getitem__() api to _lookup().
Diffstat (limited to 'src/mailman/rest/urls.py')
-rw-r--r--src/mailman/rest/urls.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mailman/rest/urls.py b/src/mailman/rest/urls.py
index a0f1b396a..384c21dba 100644
--- a/src/mailman/rest/urls.py
+++ b/src/mailman/rest/urls.py
@@ -45,6 +45,7 @@ class AbsoluteURLMapper:
"""Initialize with respect to a context and request."""
self.context = context
self.request = request
+ # XXX Is this strictly necessary?
self.webservice_config = AdminWebServiceConfiguration()
self.version = self.webservice_config.service_version_uri_prefix
self.schema = ('https' if self.webservice_config.use_https else 'http')
@@ -53,13 +54,14 @@ class AbsoluteURLMapper:
def __str__(self):
"""Return the semi-hard-coded URL to the service root."""
- path = self[self.context]
+ path = self._lookup(self.context)
return '{0.schema}://{0.hostname}:{0.port}/{0.version}/{1}'.format(
self, path)
+ # XXX Is this strictly necessary?
__call__ = __str__
- def __getitem__(self, ob):
+ def _lookup(self, ob):
"""Return the path component for the object.
:param ob: The object we're looking for.