Author: jvloothuis
Date: Sun Sep 16 18:38:56 2007
New Revision: 46678

Added:
   kukit/kss.templates/trunk/kss/templates/zope_plugin/
   kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/
   
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl
   
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl
   
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl
Modified:
   kukit/kss.templates/trunk/kss/templates/util.py
Log:

Added a new template which should (in the future) work with the current kss.core


Modified: kukit/kss.templates/trunk/kss/templates/util.py
==============================================================================
--- kukit/kss.templates/trunk/kss/templates/util.py     (original)
+++ kukit/kss.templates/trunk/kss/templates/util.py     Sun Sep 16 18:38:56 2007
@@ -8,3 +8,8 @@
         var('namespace', 
             'The namespace for your plugin (something like `my-namespace`)'),
         ]
+
+class KSSZopePluginTemplate(Template):
+    _template_dir = 'zope_plugin'
+    summary = 'KSS Zope plugin template'
+    required_templates = ['kss_plugin']

Added: 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl
==============================================================================
--- (empty file)
+++ 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl  
    Sun Sep 16 18:38:56 2007
@@ -0,0 +1,10 @@
+from kss.core.kssview import CommandSet
+
+class ${package.capitalize()}Commands(CommandSet):
+
+    # Add your own actions here, you can use the following code as
+    #  a starting point
+    def yourAction(self, selector, data):
+        command = self.commands.addCommand('yourAction', selector)
+        # Repeat for each parameter you need
+        command.addParam('parameter', data)

Added: 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl
==============================================================================
--- (empty file)
+++ 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl
   Sun Sep 16 18:38:56 2007
@@ -0,0 +1,48 @@
+<configure xmlns="http://namespaces.zope.org/zope";
+     xmlns:browser="http://namespaces.zope.org/browser";
+     xmlns:kss="http://namespaces.zope.org/kss";
+     xmlns:zcml="http://namespaces.zope.org/zcml";
+     >
+     
+    <!-- Third party library dependencies -->
+    <!--
+    <browser:resource
+        file="3rd_party/prototype.js"
+        name="prototype.js"
+        />
+
+    <browser:resource
+        file="3rd_party/effects.js"
+        name="effects.js"
+        />
+    -->
+  
+
+    <!-- Event types -->
+    <!--
+    <kss:eventtype
+        name="myCustomEventType"
+        jsfile="browser/my_plugins.js"
+        />
+    -->
+
+    <!-- Client actions & commands -->
+    <!--
+    <kss:action
+        name="myCustomAction"
+        jsfile="browser/my_plugins.js"
+        command_factory="selector/global"
+        params_mandatory="param1 param2 ... paramN"
+        params_optional=""
+        />
+    -->
+
+    <!-- Command sets -->
+    <kss:commandset
+         name="${namespace}"
+         for="kss.core.interfaces.IKSSView"
+         class=".commands.${package.capitalize()}Commands"
+         provides=".interfaces.I${package.capitalize()}Commands"
+         />
+
+</configure>

Added: 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl
==============================================================================
--- (empty file)
+++ 
kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl
    Sun Sep 16 18:38:56 2007
@@ -0,0 +1,7 @@
+from zope.interface import Interface
+
+class I${package.capitalize()}Commands(Interface):
+    '''Documentation for your command set'''
+
+    def yourAction(selector, data):
+        '''Documentation on yourAction'''
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to