Author: jvloothuis
Date: Sun Nov 11 14:00:53 2007
New Revision: 48562

Modified:
   kukit/kss.zope/trunk/kss/zope/registry.py
   kukit/kss.zope/trunk/kss/zope/registry.txt
Log:

Added reset code for BBB registries (usefull for tests)


Modified: kukit/kss.zope/trunk/kss/zope/registry.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/registry.py   (original)
+++ kukit/kss.zope/trunk/kss/zope/registry.py   Sun Nov 11 14:00:53 2007
@@ -57,5 +57,12 @@
     if filename not in bbb_extra_javascripts:
         bbb_extra_javascripts.append(filename)
 
-
+def bbb_clear_out():
+    global bbb_commandsets
+    bbb_commandsets = {}
+    global bbb_javascripts
+    bbb_javascripts = []
+    global bbb_extra_javascripts
+    bbb_extra_javascripts = []
+    
         

Modified: kukit/kss.zope/trunk/kss/zope/registry.txt
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/registry.txt  (original)
+++ kukit/kss.zope/trunk/kss/zope/registry.txt  Sun Nov 11 14:00:53 2007
@@ -94,3 +94,18 @@
   >>> list(registry.extra_javascripts())
   [..., '/some_other/path.js']
 
+Now we can reset the bbb registry to be empty again.
+
+  >>> from kss.zope.registry import bbb_clear_out
+  >>> bbb_clear_out()
+  
+  >>> 'some/path.js' in list(registry.javascripts())
+  False
+
+  >>> 'some_other/path.js' in list(registry.extra_javascripts())
+  False
+
+  >>> registry.lookup_commandset('cheese')
+  Traceback (most recent call last):
+  ...
+  KeyError: 'cheese'
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to