------------------------------------------------------------
revno: 6757
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Thu 2009-08-06 17:15:07 -0400
message:
  Get rid of the Traverse class by checking for None returned from ob.get().
removed:
  src/mailman/rest/traverse.py
modified:
  src/mailman/rest/publication.py
  src/mailman/rest/webservice.py


--
lp:mailman
https://code.launchpad.net/~mailman-coders/mailman/3.0

Your team Mailman Checkins is subscribed to branch lp:mailman.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/3.0/+edit-subscription.
=== modified file 'src/mailman/rest/publication.py'
--- src/mailman/rest/publication.py	2009-08-06 21:05:53 +0000
+++ src/mailman/rest/publication.py	2009-08-06 21:15:07 +0000
@@ -66,7 +66,10 @@
         resolver = IResolvePathNames(ob, missing)
         if resolver is missing:
             raise NotFound(ob, name, request)
-        return ob.get(name)
+        next_step = ob.get(name)
+        if next_step is None:
+            raise NotFound(ob, name, request)
+        return next_step
 
     def afterTraversal(self, request, ob):
         """See `IPublication`."""

=== removed file 'src/mailman/rest/traverse.py'
--- src/mailman/rest/traverse.py	2009-08-06 21:05:53 +0000
+++ src/mailman/rest/traverse.py	1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-# Copyright (C) 2009 by the Free Software Foundation, Inc.
-#
-# This file is part of GNU Mailman.
-#
-# GNU Mailman is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or (at your option)
-# any later version.
-#
-# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
-
-"""Traversal rules for the Mailman RESTful admin web service."""
-
-# XXX BAW 2009-08-06 Can we get rid of this module?  It only seems to be used
-# for NotFound traversals from the top level.  See the failure in basic.txt if
-# we remove this module.
-
-from __future__ import absolute_import, unicode_literals
-
-__metaclass__ = type
-__all__ = [
-    'Traverse',
-    ]
-
-
-from urllib import unquote
-
-from zope.interface import implements
-from zope.publisher.interfaces import IPublishTraverse, NotFound
-
-
-
-class Traverse:
-    """An implementation of `IPublishTraverse` that uses the get() method."""
-
-    implements(IPublishTraverse)
-
-    def __init__(self, context, request):
-        self.context = context
-
-    def publishTraverse(self, request, name):
-        """See `IPublishTraverse`."""
-        name = unquote(name)
-        value = self.context.get(name)
-        if value is None:
-            raise NotFound(self, name)
-        return value

=== modified file 'src/mailman/rest/webservice.py'
--- src/mailman/rest/webservice.py	2009-07-21 11:07:58 +0000
+++ src/mailman/rest/webservice.py	2009-08-06 21:15:07 +0000
@@ -37,6 +37,7 @@
 from lazr.restful.publisher import WebServiceRequestTraversal
 from zope.interface import implements
 from zope.publisher.browser import BrowserRequest
+from zope.publisher.interfaces import NotFound
 from zope.publisher.publish import publish
 
 from mailman.config import config

_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to