From 25a3786da9d299a52d82d8b884a9ecb6e2b2cf39 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 11 May 2009 23:00:30 -0400 Subject: A little bit of cleanup. --- src/mailman/rest/testing/server.py | 3 +-- src/mailman/rest/urls.py | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mailman/rest/testing/server.py b/src/mailman/rest/testing/server.py index d1799d0c2..35a3f2b72 100644 --- a/src/mailman/rest/testing/server.py +++ b/src/mailman/rest/testing/server.py @@ -52,8 +52,7 @@ class TestableServer: def stop(self): """Stop the server by firing the event.""" self.event.set() - # Fire off one more request so the handle_request() will exit. XXX - # Should we set a .timeout on the server instead? + # Fire off one more request so the handle_request() will exit. fp = urlopen('http://localhost:8001/3.0/system') fp.close() self.thread.join() diff --git a/src/mailman/rest/urls.py b/src/mailman/rest/urls.py index 384c21dba..cdd921d4e 100644 --- a/src/mailman/rest/urls.py +++ b/src/mailman/rest/urls.py @@ -45,22 +45,18 @@ 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') self.hostname = config.webservice.hostname self.port = int(config.webservice.port) - def __str__(self): + def __call__(self): """Return the semi-hard-coded URL to the service root.""" 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 _lookup(self, ob): """Return the path component for the object. -- cgit v1.2.3-70-g09d2