[Zope-CVS] SVN: book/trunk/insensitivefolder/ Made sure this will
not conflict with the zope.app.demo version.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Aug 24 13:56:37 EDT 2004
Log message for revision 27249:
Made sure this will not conflict with the zope.app.demo version.
Changed:
U book/trunk/insensitivefolder/__init__.py
U book/trunk/insensitivefolder/configure.zcml
-=-
Modified: book/trunk/insensitivefolder/__init__.py
===================================================================
--- book/trunk/insensitivefolder/__init__.py 2004-08-24 17:55:42 UTC (rev 27248)
+++ book/trunk/insensitivefolder/__init__.py 2004-08-24 17:56:37 UTC (rev 27249)
@@ -27,29 +27,6 @@
from zope.app.container.traversal import ContainerTraverser
-class CaseInsensitiveFolderTraverser(ContainerTraverser):
-
- __used_for__ = ICaseInsensitiveFolder
-
- def publishTraverse(self, request, name):
- """See zope.publisher.interfaces.browser.IBrowserPublisher"""
- subob = self._guessTraverse(name)
- if subob is None:
- view = zapi.queryView(self.context, name, request)
- if view is not None:
- return view
-
- raise NotFound(self.context, name, request)
-
- return subob
-
- def _guessTraverse(self, name):
- for key in self.context.keys():
- if key.lower() == name.lower():
- return self.context[key]
- return None
-
-
class ICaseInsensitiveFolder(IFolder):
"""Marker for folders whose contained items keys are case insensitive.
@@ -80,3 +57,26 @@
return implementedBy(Folder) + ICaseInsensitiveFolder
caseInsensitiveFolderFactory = CaseInsensitiveFolderFactory()
+
+
+class CaseInsensitiveFolderTraverser(ContainerTraverser):
+
+ __used_for__ = ICaseInsensitiveFolder
+
+ def publishTraverse(self, request, name):
+ """See zope.publisher.interfaces.browser.IBrowserPublisher"""
+ subob = self._guessTraverse(name)
+ if subob is None:
+ view = zapi.queryView(self.context, name, request)
+ if view is not None:
+ return view
+
+ raise NotFound(self.context, name, request)
+
+ return subob
+
+ def _guessTraverse(self, name):
+ for key in self.context.keys():
+ if key.lower() == name.lower():
+ return self.context[key]
+ return None
Modified: book/trunk/insensitivefolder/configure.zcml
===================================================================
--- book/trunk/insensitivefolder/configure.zcml 2004-08-24 17:55:42 UTC (rev 27248)
+++ book/trunk/insensitivefolder/configure.zcml 2004-08-24 17:56:37 UTC (rev 27249)
@@ -23,12 +23,12 @@
<!-- Case-insensitive Folder Registration -->
<factory
- id="zope.CaseInsensitiveFolder"
+ id="book.CaseInsensitiveFolder"
component=".caseInsensitiveFolderFactory"
/>
<browser:addMenuItem
- factory="zope.CaseInsensitiveFolder"
+ factory="book.CaseInsensitiveFolder"
title="Case insensitive Folder"
description="A simple case insensitive Folder."
permission="zope.ManageContent"
More information about the Zope-CVS
mailing list