[KSS-checkins] r35948 - in kukit/kss.core/trunk: . plugins/core plugins/effects

reebalazs at codespeak.net reebalazs at codespeak.net
Fri Dec 22 12:01:18 CET 2006


Author: reebalazs
Date: Fri Dec 22 12:01:15 2006
New Revision: 35948

Modified:
   kukit/kss.core/trunk/azaxview.py
   kukit/kss.core/trunk/interfaces.py
   kukit/kss.core/trunk/plugins/core/commands.py
   kukit/kss.core/trunk/plugins/effects/commands.py
Log:
Renamed AzaxViewAdapter to CommandSet. Fixed its lieing interface. Moved __allow...unprotected to the CommandSet from the plugin implementations.

Modified: kukit/kss.core/trunk/azaxview.py
==============================================================================
--- kukit/kss.core/trunk/azaxview.py	(original)
+++ kukit/kss.core/trunk/azaxview.py	Fri Dec 22 12:01:15 2006
@@ -38,7 +38,7 @@
 
 from commands import AzaxCommands
 from events import AzaxEvent
-from interfaces import IAzaxEvent, IAzaxView
+from interfaces import IAzaxEvent, IAzaxView, ICommandSet
 from pluginregistry.commandset import getRegisteredCommandSet
 from zope import app, component, interface
 from zope.component import getSiteManager
@@ -150,8 +150,13 @@
         # return the adapted view
         return commandset.provides(self)
 
-class AzaxViewAdapter:
-    implements(IAzaxView)
+class CommandSet:
+    implements(ICommandSet)
+
+    # XXX This is really bad. Is is needed for restricted access?
+    # If not, it has to go. If no, it needs an alternate solution.
+    # also we need test for this.
+    __allow_access_to_unprotected_subobjects__ = True
 
     def __init__(self, view):
         self.view = view
@@ -161,3 +166,6 @@
 
     def getCommandSet(self, name):
         return self.view.getCommandSet(name)
+
+# XXX to be deprecated
+AzaxViewAdapter = CommandSet

Modified: kukit/kss.core/trunk/interfaces.py
==============================================================================
--- kukit/kss.core/trunk/interfaces.py	(original)
+++ kukit/kss.core/trunk/interfaces.py	Fri Dec 22 12:01:15 2006
@@ -110,6 +110,12 @@
     def render():
         ''
 
+class ICommandSet(Interface):
+    'Methods of this class implement a command set'
+
+    def getCommandSet(self, name):
+        'Returns the command set for a given name'
+
 class IAzaxEvent(Interface):
     """Used to notify of events during an Ajax call
     

Modified: kukit/kss.core/trunk/plugins/core/commands.py
==============================================================================
--- kukit/kss.core/trunk/plugins/core/commands.py	(original)
+++ kukit/kss.core/trunk/plugins/core/commands.py	Fri Dec 22 12:01:15 2006
@@ -1,13 +1,12 @@
 from interfaces import IKSSCoreCommands
 from kss.core.selectors import Selector, CssSelector, HtmlIdSelector
-from kss.core.azaxview import AzaxViewAdapter
+from kss.core.azaxview import CommandSet
 from kss.core.deprecated import deprecated
 from kss.core.parsers import XmlParser, HtmlParser
 from kss.core.plugins.core.interfaces import IKSSCoreCommands
 from zope.interface import implements
 
-class KSSCoreCommands(AzaxViewAdapter):
-    __allow_access_to_unprotected_subobjects__ = 1
+class KSSCoreCommands(CommandSet):
     implements(IKSSCoreCommands)
 
     def getSelector(self, type, selector):

Modified: kukit/kss.core/trunk/plugins/effects/commands.py
==============================================================================
--- kukit/kss.core/trunk/plugins/effects/commands.py	(original)
+++ kukit/kss.core/trunk/plugins/effects/commands.py	Fri Dec 22 12:01:15 2006
@@ -1,8 +1,7 @@
 from interfaces import IScriptaculousEffectsCommands
-from kss.core.azaxview import AzaxViewAdapter
+from kss.core.azaxview import CommandSet
 
-class ScriptaculousEffectsCommands(AzaxViewAdapter):
-    __allow_access_to_unprotected_subobjects__ = 1
+class ScriptaculousEffectsCommands(CommandSet):
 
     def effect(self, selector, type):
         """ see interfaces.py """


More information about the Kukit-checkins mailing list