Author: jvloothuis
Date: Fri May 2 18:01:08 2008
New Revision: 54338
Modified:
kukit/kss.zope/trunk/kss/zope/bbb/commandset.py
kukit/kss.zope/trunk/kss/zope/registry.py
kukit/kss.zope/trunk/kss/zope/registry.txt
Log:
Reverting my change on trunk
Modified: kukit/kss.zope/trunk/kss/zope/bbb/commandset.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/bbb/commandset.py (original)
+++ kukit/kss.zope/trunk/kss/zope/bbb/commandset.py Fri May 2 18:01:08 2008
@@ -1,26 +1,12 @@
-#from deprecated import deprecated
-
-from kss.base import core
+# BBB selector compat wrapper
from kss.zope.commandset import ZopeCommandSet
+from kss.base.corecommands import KSSCoreCommands
+##from deprecated import deprecated
-class CommandWrapper(object):
- def __init__(self, command, commands):
- self.command = command
- self.commands = commands
-
- def __call__(self, *args, **kwargs):
- self.command(self.commands, *args, **kwargs)
-
-# BBB core command compat
-class KSSCoreCommands(ZopeCommandSet):
- def __getattr__(self, name):
- return CommandWrapper(getattr(core, name), self.commands)
+when = 'after 2008-08-01'
-
-# BBB selector compat wrapper
-pwhen = 'after 2008-08-01'
-class CompatCommandSet(KSSCoreCommands):
+class CompatCommandSet(ZopeCommandSet, KSSCoreCommands):
## Don't BBB yet. Uncommenting the next line will activate BBB.
[EMAIL PROTECTED]('use getattr(view.selectors, type)(value) instead', when)
Modified: kukit/kss.zope/trunk/kss/zope/registry.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/registry.py (original)
+++ kukit/kss.zope/trunk/kss/zope/registry.py Fri May 2 18:01:08 2008
@@ -2,9 +2,8 @@
from kss.base.plugin import available_plugins
from kss.zope.interfaces import IKSSPluginRegistry
-# BBB registries for configuration of plugins through ZCML etc.
-from kss.zope.bbb.commandset import KSSCoreCommands
-BBB_commandsets = {'core': KSSCoreCommands}
+# BBB registries for configuration of plugins through ZCML
+BBB_commandsets = {}
BBB_javascripts = []
class GlobalPluginRegistry(object):
@@ -66,8 +65,8 @@
return self._extra_javascripts
def lookup_commandset(self, id):
- commandsets = dict(self._commandsets)
- commandsets.update(BBB_commandsets.copy())
+ commandsets = BBB_commandsets.copy()
+ commandsets.update(self._commandsets)
return commandsets[id]
def lookup_selector(self, id):
Modified: kukit/kss.zope/trunk/kss/zope/registry.txt
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/registry.txt (original)
+++ kukit/kss.zope/trunk/kss/zope/registry.txt Fri May 2 18:01:08 2008
@@ -58,7 +58,7 @@
Loading the commandset for the core should be possible.
>>> registry.lookup_commandset('core')
- <class '...KSSCoreCommands'>
+ <class 'kss.base.corecommands.KSSCoreCommands'>
As you can see it returns a factory (in this case the class) for the
commandset.
@@ -105,8 +105,8 @@
registration is a simple call to the registry with a commandset
factory.
- >>> from kss.zope.commandset import ZopeCommandSet
- >>> class CheeseCommandSet(ZopeCommandSet):
+ >>> from kss.base.commands import KSSCommandSet
+ >>> class CheeseCommandSet(KSSCommandSet):
... pass
>>> BBB_register_commandset('cheese', CheeseCommandSet)
>>> registry.lookup_commandset('cheese')
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins