Author: jvloothuis
Date: Sun Nov 11 15:16:10 2007
New Revision: 48569

Modified:
   kukit/kss.zope/trunk/kss/zope/commands.py
   kukit/kss.zope/trunk/kss/zope/commandset.py
Log:

Lookup of Zope specific commandsets now works.

Added a compat wrapper for the `core` commandset to include selectors.


Modified: kukit/kss.zope/trunk/kss/zope/commands.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/commands.py   (original)
+++ kukit/kss.zope/trunk/kss/zope/commands.py   Sun Nov 11 15:16:10 2007
@@ -2,6 +2,8 @@
 from kss.base import KSSCommands
 
 from kss.zope.interfaces import IKSSPluginRegistry, IZopeCommandSet
+from kss.zope.commandset import CompatCommandSet
+
 
 class KSSZopeCommands(KSSCommands):
     def __init__(self, view, context, request):
@@ -13,7 +15,12 @@
     def __getattr__(self, name):
         registry = component.getUtility(IKSSPluginRegistry)
         commandset_factory = registry.lookup_commandset(name)
-        if IZopeCommandSet.implementedBy(commandset_factory):
+
+        # BBB hack for adding more stuff to the core
+        if name == 'core': 
+            return CompatCommandSet(self.view)
+        # end of BBB
+        elif IZopeCommandSet.implementedBy(commandset_factory):
             return commandset_factory(self.view)
         else:
             return commandset_factory(self)

Modified: kukit/kss.zope/trunk/kss/zope/commandset.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/commandset.py (original)
+++ kukit/kss.zope/trunk/kss/zope/commandset.py Sun Nov 11 15:16:10 2007
@@ -1,8 +1,10 @@
 from zope import interface
+from kss.base.coreselectors import htmlid, css
+from kss.base.corecommands import KSSCoreCommands
 
 from kss.zope.interfaces import IZopeCommandSet
 
-class ZopeCommandSet:
+class ZopeCommandSet(object):
     interface.implements(IZopeCommandSet)
 
     def __init__(self, view):
@@ -14,3 +16,11 @@
     def getCommandSet(self, name):
         return self.view.getCommandSet(name)
 
+# BBB selector compat wrapper
+class CompatCommandSet(ZopeCommandSet, KSSCoreCommands):
+
+    def getHtmlIdSelector(self, value):
+        return htmlid(value)
+
+    def getCssSelector(self, value):
+        return css(value)
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to