[Zope3-checkins] CVS: Zope3/src/zope/app/onlinehelp - __init__.py:1.10 metaconfigure.py:1.3
Stephan Richter
srichter@cosmos.phy.tufts.edu
Tue, 15 Jul 2003 10:20:46 -0400
Update of /cvs-repository/Zope3/src/zope/app/onlinehelp
In directory cvs.zope.org:/tmp/cvs-serv27081/src/zope/app/onlinehelp
Modified Files:
__init__.py metaconfigure.py
Log Message:
Fixed the online help to do the right thing (finally). While the interfaces
said it all along, I still expected View classes in the 'view' attribute
of the help:register directive. I now (and should) uses the view name given
to a view.
In the process I also activated the unregister tests.
=== Zope3/src/zope/app/onlinehelp/__init__.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/onlinehelp/__init__.py:1.9 Tue Jun 24 10:58:14 2003
+++ Zope3/src/zope/app/onlinehelp/__init__.py Tue Jul 15 10:20:12 2003
@@ -22,7 +22,7 @@
from zope.app.container.sample import SampleContainer
from zope.app.traversing import getParent, getName
from zope.app.interfaces.traversing import IContainmentRoot
-from zope.app.traversing.adapters import Traverser
+from zope.app.traversing import traverse
import zope.app
from zope.app.context import ContextWrapper
@@ -87,8 +87,7 @@
def registerHelpTopic(self, parent_path, id, title,
doc_path, doc_type='txt', interface=None, view=None):
"See Zope.App.OnlineHelp.interfaces.IOnlineHelp"
- #parent = traverse(self, parent_path)
- parent = Traverser(self).traverse(parent_path)
+ parent = traverse(self, parent_path)
# Create and add topic
id = parent.setObject(id, OnlineHelpTopic(title, doc_path, doc_type))
topic = ContextWrapper(parent[id], parent, name=id)
@@ -100,12 +99,12 @@
def unregisterHelpTopic(self, topic_path):
"See Zope.App.OnlineHelp.interfaces.IOnlineHelp"
# Delete topic from tree
- topic = Traverser(self).traverse(topic_path)
+ topic = traverse(self, topic_path)
name = getName(topic)
parent = getParent(topic)
del parent[name]
# unregister from registry
- for item in registry.items():
+ for item in self._registry.items():
if topic in item[1]:
item[1].remove(topic)
=== Zope3/src/zope/app/onlinehelp/metaconfigure.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/onlinehelp/metaconfigure.py:1.2 Wed Apr 9 16:51:32 2003
+++ Zope3/src/zope/app/onlinehelp/metaconfigure.py Tue Jul 15 10:20:12 2003
@@ -32,8 +32,6 @@
doc_path = os.path.normpath(doc_path)
if for_ is not None:
for_ = resolveInterface(_context, for_)
- if view is not None:
- view = _context.resolve(view)
return [
Action(discriminator = ('registerHelpTopic', parent, title),