[KSS-checkins] r49288 - kukit/kss.zope/trunk/kss/core/plugins/core
reebalazs at codespeak.net
reebalazs at codespeak.net
Sun Dec 2 17:35:51 CET 2007
Author: reebalazs
Date: Sun Dec 2 17:35:51 2007
New Revision: 49288
Removed:
kukit/kss.zope/trunk/kss/core/plugins/core/commands.py
kukit/kss.zope/trunk/kss/core/plugins/core/interfaces.py
Modified:
kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml
Log:
Remove now unneeded stuff
Deleted: /kukit/kss.zope/trunk/kss/core/plugins/core/commands.py
==============================================================================
--- /kukit/kss.zope/trunk/kss/core/plugins/core/commands.py Sun Dec 2 17:35:51 2007
+++ (empty file)
@@ -1,198 +0,0 @@
-from kss.core.selectors import Selector, CssSelector, HtmlIdSelector
-from kss.core.selectors import ParentNodeSelector, SameNodeSelector
-from kss.core.kssview import CommandSet
-from kss.core.deprecated import deprecated, deprecated_warning
-from kss.core.parsers import HtmlParser
-from kss.core.plugins.core.interfaces import IKSSCoreCommands
-from zope.interface import implements
-
-class KSSCoreCommands(CommandSet):
- implements(IKSSCoreCommands)
-
- def getSelector(self, type, selector):
- 'Get a selector of a given type'
- return Selector(type, selector)
-
- def getCssSelector(self, selector):
- return CssSelector(selector)
-
- def getHtmlIdSelector(self, selector):
- return HtmlIdSelector(selector)
-
- def getSameNodeSelector(self):
- return SameNodeSelector()
-
- def getParentNodeSelector(self, selector):
- return ParentNodeSelector(selector)
-
- # XXX the list is not full: maybe complete them?
-
- def replaceInnerHTML(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('replaceInnerHTML', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def replaceHTML(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('replaceHTML', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def setAttribute(self, selector, name, value):
- """ see interfaces.py """
- command = self.commands.addCommand('setAttribute', selector)
- data = command.addParam('name', name)
- data = command.addParam('value', value)
-
- def setStyle(self, selector, name, value):
- """ see interfaces.py """
- command = self.commands.addCommand('setStyle', selector)
- data = command.addParam('name', name)
- data = command.addParam('value', value)
-
- def insertHTMLAfter(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('insertHTMLAfter', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def insertHTMLAsFirstChild(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('insertHTMLAsFirstChild', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def insertHTMLAsLastChild(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('insertHTMLAsLastChild', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def insertHTMLBefore(self, selector, new_value, withKssSetup='True'):
- """ see interfaces.py """
- command = self.commands.addCommand('insertHTMLBefore', selector)
- data = command.addHtmlParam('html', new_value)
- data = command.addParam('withKssSetup', withKssSetup)
-
- def clearChildNodes(self, selector):
- """ see interfaces.py """
- command = self.commands.addCommand('clearChildNodes', selector)
-
- def deleteNode(self, selector):
- """ see interfaces.py """
- command = self.commands.addCommand('deleteNode', selector)
-
- def deleteNodeAfter(self, selector):
- """ see interfaces.py """
- command = self.commands.addCommand('deleteNodeAfter', selector)
-
- def deleteNodeBefore(self, selector):
- """ see interfaces.py """
- command = self.commands.addCommand('deleteNodeBefore', selector)
-
- def copyChildNodesFrom(self, selector, id):
- """ see interfaces.py """
- command = self.commands.addCommand('copyChildNodesFrom', selector)
- data = command.addParam('html_id', id)
-
- def moveNodeAfter(self, selector, id):
- """ see interfaces.py """
- command = self.commands.addCommand('moveNodeAfter', selector)
- data = command.addParam('html_id', id)
-
- def moveNodeBefore(self, selector, id):
- """ see interfaces.py """
- command = self.commands.addCommand('moveNodeBefore', selector)
- data = command.addParam('html_id', id)
-
- def copyChildNodesTo(self, selector, id):
- """ see interfaces.py """
- command = self.commands.addCommand('copyChildNodesTo', selector)
- data = command.addParam('html_id', id)
-
- def setStateVar(self, varname, value):
- """ see interfaces.py """
- command = self.commands.addCommand('setStateVar')
- command.addParam('varname', varname)
- command.addParam('value', value)
-
- def triggerEvent(self, name, **kw):
- """ see interfaces.py """
- command = self.commands.addCommand('triggerEvent')
- command.addParam('name', name)
- for key, value in kw.iteritems():
- command.addParam(key, value)
-
- def toggleClass(self, selector, *arg, **kw):
- ##def toggleClass(self, selector, value):
- """ see interfaces.py """
- # BBB 4 months, until 2007-10-18
- value = BBB_classParms('toggleClass', *arg, **kw)
-
- command = self.commands.addCommand('toggleClass', selector)
- data = command.addParam('value', value)
-
- def addClass(self, selector, *arg, **kw):
- ##def addClass(self, selector, name):
- """ see interfaces.py """
- # BBB 4 months, until 2007-10-18
- value = BBB_classParms('addClass', *arg, **kw)
-
- command = self.commands.addCommand('addClass', selector)
- data = command.addParam('value', value)
-
- def removeClass(self, selector, *arg, **kw):
- ##def removeClass(self, selector, name):
- """ see interfaces.py """
- # BBB 4 months, until 2007-10-18
- value = BBB_classParms('removeClass', *arg, **kw)
-
- command = self.commands.addCommand('removeClass', selector)
- data = command.addParam('value', value)
-
- def focus(self, selector):
- """ see interfaces.py """
- command = self.commands.addCommand('focus', selector)
-
- # XXX Deprecated ones
-
- # BBB until 2007-10-18
- def moveChildrenTo(self, selector, id):
- """ see interfaces.py """
- self.copyChildrenTo(selector, id)
- self.clearChildren(selector)
- moveChildrenTo = deprecated(moveChildrenTo, 'No more supported, use a sequence of copyChildrenTo and clearChildren')
-
- # BBB until 2007-10-18
- setHtmlAsChild = deprecated(replaceInnerHTML, 'use replaceInnerHTML instead')
- addAfter = deprecated(insertHTMLAfter, 'use insertHTMLAfter instead')
- clearChildren = deprecated(clearChildNodes, 'use clearChildNodes instead')
- removeNode = deprecated(deleteNode, 'use deleteNode instead')
- removeNextSibling = deprecated(deleteNodeAfter, 'use deleteNodeAfter instead')
- removePreviousSibling = deprecated(deleteNodeBefore, 'use deleteNodeBefore instead')
- copyChildrenFrom = deprecated(copyChildNodesFrom, 'use copyChildNodesFrom instead')
- copyChildrenTo = deprecated(copyChildNodesTo, 'use copyChildNodesTo instead')
- setStatevar = deprecated(setStateVar, 'use setStateVar (capital V) instead')
-
- # BBB 4 month, until 2007-10-18
- addClassName = deprecated(addClass, 'use addClass instead')
- removeClassName = deprecated(removeClass, 'use removeClass instead')
-
-# BBB 4 month, until 2007-10-18
-def BBB_classParms(commandname, value=None, classname=None, name=None):
- if classname:
- deprecated_warning(('Deprecated the "classname" parameter in the "%s" command, ' +
- 'use "name" instead.') % (commandname ,))
- if not value:
- value = classname
- if name:
- deprecated_warning(('Deprecated the "name" parameter in the "%s" command, ' +
- 'use "name" instead.') % (commandname ,))
- if not value:
- value = name
- if not value:
- raise Exception, 'Parameter "value" is mandatory in command "%s"' % (commandname, )
- return value
-
- # end deprecated
Modified: kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml (original)
+++ kukit/kss.zope/trunk/kss/core/plugins/core/configure.zcml Sun Dec 2 17:35:51 2007
@@ -416,13 +416,7 @@
<!-- Command sets -->
- <!-- XXX is already in kss.base
- <kss:commandset
- name="core"
- for="kss.core.interfaces.IKSSView"
- provides=".interfaces.IKSSCoreCommands"
- class=".commands.KSSCoreCommands"
- />
- -->
+ <!-- XXX is already in kss.base -->
+
</configure>
Deleted: /kukit/kss.zope/trunk/kss/core/plugins/core/interfaces.py
==============================================================================
--- /kukit/kss.zope/trunk/kss/core/plugins/core/interfaces.py Sun Dec 2 17:35:51 2007
+++ (empty file)
@@ -1,96 +0,0 @@
-from zope.interface import Interface
-
-class IKSSCoreCommands(Interface):
- """The core commands"""
-
- def getSelector(type, selector):
- """Return a specific type of selector
-
- The type can be `css` or `htmlid`. The selector is the value for the
- selector."""
-
- def getCssSelector(selector):
- """Return a CSS selector with selector as the value"""
-
- def getHtmlIdSelector(selector):
- """Return a HTML id selector with selector as the value"""
-
- def getSameNodeSelector():
- """Return the same node as the value"""
-
- def getParentNodeSelector(selector):
- """Return a all nodes in the parent chain which match the css
- selector"""
-
- def replaceInnerHTML(selector, new_value, withKssSetup='True'):
- """Replace the contents of a node (selector) with the new_value"""
-
- def replaceHTML(selector, new_value, withKssSetup='True'):
- """Replace the node itself with new_value
-
- Node selection is done using the selector argument."""
-
- def setAttribute(selector, name, value):
- """Set an attribute on node(s) specified by the selector"""
-
- def setStyle(selector, name, value):
- """Set the style attribute of nodes specified by the selector"""
-
- def insertHTMLAfter(selector, new_value, withKssSetup='True'):
- """Insert some HTML after the node indicated by selector"""
-
- def insertHTMLBefore(selector, new_value, withKssSetup='True'):
- """Insert some HTML before the node specified by selector"""
-
- def insertHTMLAsFirstChild(selector, new_value, withKssSetup='True'):
- """Insert some HTML as the first child of the node specified by selector"""
-
- def insertHTMLAsLastChild(selector, new_value, withKssSetup='True'):
- """Insert some HTML as the last child of the node specified by selector"""
-
- def clearChildNodes(selector):
- """Remove all the child nodes from the node specified by selector"""
-
- def deleteNode(selector):
- """Remove the node itself specified by selector"""
-
- def deleteNodeAfter(selector):
- """Remove the node after the node specified by selector"""
-
- def deleteNodeBefore(selector):
- """Remove the node before the node specified by selector"""
-
- def copyChildNodesFrom(selector, id):
- """Copy the child nodes from the node specified by id to the selector node
-
- The copy operation will clear out all childnodes of selector."""
-
- def copyChildNodesTo(selector, id):
- """Copy the child nodes from the selector node to the node specified by id
-
- The copy operation will clear out all childnodes of selector."""
-
- def moveNodeAfter(selector, id):
- """Move the node indicated by selector to a sibling after id"""
-
- def setStateVar(varname, value):
- """Set a client side kukit variable"""
-
- def triggerEvent(name, **kw):
- """Trigger an event on the client """
- # TODO: explain a bit better what this does
-
- def toggleClass(selector, value):
- """Add/remove a class to/from a node.
-
- If the class is present it will be removed. Else the class will be
- added. """
-
- def addClass(selector, value):
- """Add a class to a node."""
-
- def removeClass(selector, value):
- """Remove a class from a node."""
-
- def focus(selector):
- """Set focus to selected node."""
More information about the Kukit-checkins
mailing list