Author: jvloothuis
Date: Fri Jun 29 23:13:32 2007
New Revision: 44634
Modified:
kukit/kss.commands/trunk/kss/commands/README.txt
kukit/kss.commands/trunk/kss/commands/commands.py
kukit/kss.commands/trunk/kss/commands/corecommands.py
Log:
Changed API to lookup commansets to be shorter and in the process
removed the underscores. This helps when the command class methods are
converted to caps.
Modified: kukit/kss.commands/trunk/kss/commands/README.txt
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/README.txt (original)
+++ kukit/kss.commands/trunk/kss/commands/README.txt Fri Jun 29 23:13:32 2007
@@ -120,7 +120,7 @@
We can now access the command set.
- >>> core = commands.get_command_set('core')
+ >>> core = commands.get('core')
This command set is initialized and ready for usage.
Modified: kukit/kss.commands/trunk/kss/commands/commands.py
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/commands.py (original)
+++ kukit/kss.commands/trunk/kss/commands/commands.py Fri Jun 29 23:13:32 2007
@@ -1,4 +1,4 @@
-from xml.sax.saxutils import escape, quoteattr
+from xml.sax.saxutils import quoteattr
from xml.parsers.expat import ParserCreate, ExpatError
from kss.pluginregistry import command_set_registry
@@ -52,7 +52,7 @@
output.append(kss_response_footer)
return ''.join(output)
- def get_command_set(self, name):
+ def get(self, name):
return command_set_registry.get(name)(self)
class KSSCommandSet(object):
Modified: kukit/kss.commands/trunk/kss/commands/corecommands.py
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/corecommands.py (original)
+++ kukit/kss.commands/trunk/kss/commands/corecommands.py Fri Jun 29
23:13:32 2007
@@ -6,3 +6,11 @@
def replace_html(self, selector, value):
self.commands.add('replaceHTML', selector, html=value)
+
+ def insert_html_after(self, selector, value):
+ self.commands.add('insertHTMLAfter', selector, html=value)
+
+ def insert_html_as_first_child(self, selector, value):
+ self.commands.add('insertHTMLAsFirstChild', selector, html=value)
+
+
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins