diff options
author | Gintautas Miliauskas <gintas@pov.lt> | 2004-06-12 08:13:38 +0000 |
---|---|---|
committer | Gintautas Miliauskas <gintas@pov.lt> | 2004-06-12 08:13:38 +0000 |
commit | 227ec062bfda2c72a0905cf950c4f73e4c86ce1d (patch) | |
tree | 1ed67eee5b4cc9113e69fc15b16ef6a8ada0d14a | |
parent | 60154ea63948df9b05f94e17a2897f082412ff4e (diff) | |
download | zope-traversing-monolithic-zope3-zope-app-jim-index.tar.gz |
Reverted the last merge which was too excessive.monolithic-zope3-zope-app-jim-index
-rw-r--r-- | configure.zcml | 6 | ||||
-rw-r--r-- | namespace.py | 44 |
2 files changed, 1 insertions, 49 deletions
diff --git a/configure.zcml b/configure.zcml index ebbae08..9b03db9 100644 --- a/configure.zcml +++ b/configure.zcml @@ -97,10 +97,4 @@ factory="zope.app.traversing.namespace.vh" /> -<view - name="debug" type="*" - provides="zope.app.traversing.interfaces.ITraversable" for="*" - factory="zope.app.traversing.namespace.debug" - /> - </configure> diff --git a/namespace.py b/namespace.py index 456d1fe..06ecec1 100644 --- a/namespace.py +++ b/namespace.py @@ -425,52 +425,10 @@ class adapter(SimpleHandler): no adapter Cleanup: - + >>> tearDown() """ try: return component.getAdapter(self.context, IPathAdapter, name=name) except: raise NotFoundError(self.context, name) - - -class debug(view): - - def traverse(self, name, ignored): - """Debug traversal adapter - - This adapter allows debugging flags to be set in the request. - See IDebugFlags. - - Demonstration: - - >>> from zope.publisher.browser import TestRequest - >>> request = TestRequest() - >>> ob = object() - >>> adapter = debug(ob, request) - >>> request.debug.sourceAnnotations - False - >>> adapter.traverse('source', ()) is ob - True - >>> request.debug.sourceAnnotations - True - >>> adapter.traverse('source,source', ()) is ob - True - >>> try: - ... adapter.traverse('badflag', ()) - ... except ValueError: - ... print 'unknown debugging flag' - unknown debugging flag - - """ - if __debug__: - request = self.request - for flag in name.split(','): - if flag == 'source': - request.debug.sourceAnnotations = True - else: - raise ValueError("Unknown debug flag: %s" % flag) - return self.context - else: - raise ValueError("Debug flags only allowed in debug mode") - |