[KSS-checkins] r41730 - kukit/kss.core/trunk/kss/core

nouri at codespeak.net nouri at codespeak.net
Fri Mar 30 18:57:13 CEST 2007


Author: nouri
Date: Fri Mar 30 18:57:09 2007
New Revision: 41730

Modified:
   kukit/kss.core/trunk/kss/core/ttwapi.py
Log:
Alec suggested we should fire the BeforeTraverseEvent, but after
debugging for a while I stopped caring about the event and think that
setSite() is the only thing we're interested in.



Modified: kukit/kss.core/trunk/kss/core/ttwapi.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/ttwapi.py	(original)
+++ kukit/kss.core/trunk/kss/core/ttwapi.py	Fri Mar 30 18:57:09 2007
@@ -1,18 +1,17 @@
+from zope.app.component.hooks import getSite, setSite
+from zope import event
+from zope.app.publication.zopepublication import BeforeTraverseEvent
+
 from kss.core import KSSView
 from kss.core.interfaces import IKSSView
-from zope.app.component.hooks import getSite, setSite
 from kss.core.unicode_quirks import force_unicode
 
 def startKSSCommands(context, request):
     view = KSSView(context, request)
-    # XXX Setting the site at this point might be wrong thing to do.
-    # I discovered that while running test_ttwapi.py, the site would
-    # not be set by calling ``__before_publishing_traverse__``, which
-    # I think is the idea here. OTOH, it seems a bit off that we're
-    # calling ``__before_publishing_traverse__`` outside of the
-    # publisher at all. ~nouri
+    # Alec suggested we should fire the BeforeTraverseEvent, but after
+    # debugging for a while I stopped caring about the event and think
+    # that setSite() is the only thing we're interested in.
     setSite(view)
-    view.__before_publishing_traverse__(context, request)
     return view
 
 def getKSSCommandSet(name):
@@ -29,8 +28,9 @@
     #we can retrieve it...
     site = getSite()
     if not IKSSView.providedBy(site):
-        raise LookupError("You haven't initialized the KSS response yet, "
-                          "do so by calling startKSSCommands(context, request).")
+        raise LookupError(
+            "You haven't initialized the KSS response yet, "
+            "do so by calling startKSSCommands(context, request).")
     return site
 
 


More information about the Kukit-checkins mailing list