[KSS-checkins] r51199 - kukit/kss.demo/branch/kss-zope-transition/kss/demo

jvloothuis at codespeak.net jvloothuis at codespeak.net
Sat Feb 2 11:27:17 CET 2008


Author: jvloothuis
Date: Sat Feb  2 11:27:16 2008
New Revision: 51199

Modified:
   kukit/kss.demo/branch/kss-zope-transition/kss/demo/interfaces.py
Log:

Merged from trunk


Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/interfaces.py
==============================================================================
--- kukit/kss.demo/branch/kss-zope-transition/kss/demo/interfaces.py	(original)
+++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/interfaces.py	Sat Feb  2 11:27:16 2008
@@ -1,6 +1,7 @@
 from zope.interface import Interface
 from zope.schema import (
     TextLine,
+    List,
     )
 
 class ISimpleContent(Interface):
@@ -49,3 +50,94 @@
         description=u'Relative directory path, contains *.html selenium tests',
         required=False,
         )
+
+# --
+# Resource definition interfaces
+# --
+
+class IKSSDemoResource(Interface):
+    """An utility that a demo needs to register"""
+
+    # list of IKSSDemo
+    demos = List(
+        title=u"demos",
+        description=u'The ordered list of demos contained in this plugin',
+        required=True,
+        )
+
+class IKSSSeleniumTestResource(Interface):
+    """An utility that a demo needs to register"""
+
+    # list of IKSSSeleniumTestDir
+    selenium_tests = List(
+        title=u"selenium tests",
+        description=u'The list of selenium test directories contained in this plugin',
+        required=True,
+        )
+
+# --
+# The registry itself
+# --
+
+class IKSSDemoRegistry(Interface):
+    """Faciliates registration of demos.
+
+    Implementations must look after the IKSSDemoResource
+    adapters, and use their content to set up themselves.
+    """
+
+    def registerDemo(demo):
+        """Register a demo
+
+        It has the attributes specified in IKSSDemo:
+
+        plugin_namespace - string with the name of the plugin.
+                           Or: "" when it is the core part.
+
+        category         - text that will appear as the title of the
+                           category. "" if out of category.
+
+        demo_page        - (relative) url of the demo page. This should
+                           traverse on ISimpleContent.
+
+        title            - Title of the demo. This also identifies it
+                           for removal.
+        """
+ 
+    def unregisterDemo(demo):
+        """Unregister the given demo."""
+
+    def getSortedDemos():
+        """Get the (sorted) list of demos"""
+
+class IKSSSeleniumTestRegistry(Interface):
+    """Faciliates registration of demos.
+
+    Implementations must look after the IKSSSeleniumTestResource
+    adapters, and use their content to set up themselves.
+    """
+
+    def registerSeleniumTestFile(test_filename):
+        """Register a selenium test directory
+
+        It test_dir has the "filename" attributes specified in IKSSSeleniumTest.
+        """
+    
+    def unregisterSeleniumTestFile(test_filename):
+        """Unregister the given test directory."""
+
+
+# --
+# Event that gets redispatched, for allowing
+# the listeners to filter on component
+# --
+
+class IKSSDemoRegistrationEvent(Interface):
+    """Redispatched event for registration of
+    IKSSDemoRegistration utilities (resources).
+    """
+
+class IKSSDemoRegistryEvent(Interface):
+    """Redispatched event for registration of
+    IKSSDemoRegistry utilities.
+    """


More information about the Kukit-checkins mailing list