Author: jvloothuis
Date: Sat Oct 13 17:38:54 2007
New Revision: 47428

Modified:
   kukit/kss.base/trunk/kss/base/plugin.py
   kukit/kss.base/trunk/kss/base/plugin.txt
Log:

Fixed a problem because the javascripts_from was a generator (which
caused it to be only usable once). Thanks to Manuel Saelices for
detecting the problem.


Modified: kukit/kss.base/trunk/kss/base/plugin.py
==============================================================================
--- kukit/kss.base/trunk/kss/base/plugin.py     (original)
+++ kukit/kss.base/trunk/kss/base/plugin.py     Sat Oct 13 17:38:54 2007
@@ -38,7 +38,8 @@
     for dirpath, dirnames, filenames in os.walk(path):
         for filename in filenames:
             if filename.endswith('.js'):
-                yield os.path.join(dirpath, filename)
+                javascripts.append(os.path.join(dirpath, filename))
+    return javascripts
     
 def module_path(mod):
     return os.path.join(os.path.dirname(os.path.abspath(mod.__file__)))

Modified: kukit/kss.base/trunk/kss/base/plugin.txt
==============================================================================
--- kukit/kss.base/trunk/kss/base/plugin.txt    (original)
+++ kukit/kss.base/trunk/kss/base/plugin.txt    Sat Oct 13 17:38:54 2007
@@ -97,15 +97,15 @@
 iterator of all javascripts from a certain path.
 
   >>> from kss.base.plugin import javascripts_from, module_path
-  >>> list(javascripts_from(module_path(kss.base)))
+  >>> javascripts_from(module_path(kss.base))
   [.../kukit/kukit/serveraction.js', ...'.../kukit/kukit/dom.js'...]
 
 When we try to load from something which is not a directory we will
 get an error.
 
   >>> import os
-  >>> list(javascripts_from(os.path.join(module_path(kss.base),
-  ...                                    '__init__.py')))
+  >>> javascripts_from(os.path.join(module_path(kss.base),
+  ...                               '__init__.py'))
   Traceback (most recent call last):
   ...
   ValueError: Path is not a directory: .../kss/base/__init__.py
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to