[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/README.txt Clarified namespace adapter and updated expected output.
Malthe Borch
mborch at gmail.com
Tue Mar 3 04:27:46 EST 2009
Log message for revision 97435:
Clarified namespace adapter and updated expected output.
Changed:
U z3c.pt/trunk/src/z3c/pt/README.txt
-=-
Modified: z3c.pt/trunk/src/z3c/pt/README.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/README.txt 2009-03-03 09:13:13 UTC (rev 97434)
+++ z3c.pt/trunk/src/z3c/pt/README.txt 2009-03-03 09:27:46 UTC (rev 97435)
@@ -335,8 +335,10 @@
>>> class ns4(object):
... zope.interface.implements(ITraversable)
+ ...
... def __init__(self, context):
... self.context = context
+ ...
... def traverse(self, name, furtherPath):
... if name == 'page':
... if len(furtherPath) == 1:
@@ -345,11 +347,12 @@
... pagetype = 'default'
... else:
... raise TraversalError("Max 1 path segment after ns4:page")
- ... return self.page(pagetype)
+ ... return self._page(pagetype)
... if len(furtherPath) == 1:
... name = '%s/%s' % (name, furtherPath.pop())
... return 'traversed: ' + name
- ... def page(self, pagetype):
+ ...
+ ... def _page(self, pagetype):
... return 'called page: ' + pagetype
>>> zope.component.getGlobalSiteManager().registerAdapter(
@@ -385,7 +388,8 @@
<span>GRANDPA</span>
<span>2008-12-30 13:48:00</span>
<span>traversed: link:main</span>
- <span>traversed: page/another</span>
+ <span>called page: default</span>
+ <span>called page: another</span>
<span>traversed: zope.Public</span>
<span>traversed: text-to-html</span>
</div>
More information about the Checkins
mailing list