Author: dmeyer
Date: Fri Oct 12 16:45:32 2007
New Revision: 2852

Log:
Add special 'plugins' support. This can be used to install plugins to other kaa
modules and the feedparser will use it soon to hook into beacon but still
remains an extra kaa module.


Modified:
   trunk/base/src/distribution/build_py.py
   trunk/base/src/distribution/core.py

Modified: trunk/base/src/distribution/build_py.py
==============================================================================
--- trunk/base/src/distribution/build_py.py     (original)
+++ trunk/base/src/distribution/build_py.py     Fri Oct 12 16:45:32 2007
@@ -31,7 +31,13 @@
         self.kaa_compiler[ttype](tmpfile, tmpfile[:-len(ttype)] + 'py', 
'.'.join(package))
         os.unlink(tmpfile)
 
-        
+
+    def check_package (self, package, package_dir):
+        if package_dir.endswith('plugins'):
+            return None
+        return distutils.command.build_py.build_py.check_package(self, 
package, package_dir)
+
+
     def build_packages (self):
         distutils.command.build_py.build_py.build_packages(self)
         for package in self.packages:

Modified: trunk/base/src/distribution/core.py
==============================================================================
--- trunk/base/src/distribution/core.py (original)
+++ trunk/base/src/distribution/core.py Fri Oct 12 16:45:32 2007
@@ -412,12 +412,17 @@
         """
         Helper function to create 'packages' and 'package_dir'.
         """
-        if not '__init__.py' in files:
+        if not '__init__.py' in files and not dirname.endswith('plugins'):
             return
-        python_dirname = prefix + dirname[3:].replace('/', '.')
-        # Anything under module/src/extensions/foo gets translated to 
-        # kaa.module.foo.
-        python_dirname = python_dirname.replace(".extensions.", ".")
+        for key, value in kwargs.get('plugins', {}).items():
+            if dirname.startswith(value):
+                python_dirname = key + dirname[len(value):].replace('/', '.')
+                break
+        else:
+            python_dirname = prefix + dirname[3:].replace('/', '.')
+            # Anything under module/src/extensions/foo gets translated to 
+            # kaa.module.foo.
+            python_dirname = python_dirname.replace(".extensions.", ".")
         kwargs['package_dir'][python_dirname] = dirname
         kwargs['packages'].append(python_dirname)
 
@@ -436,6 +441,9 @@
     else:
         os.path.walk('src', _find_packages, (kwargs, 'kaa.' + 
kwargs['module']))
 
+    if 'plugins' in kwargs:
+        del kwargs['plugins']
+        
     # convert Extensions
     if kwargs.get('ext_modules'):
         kaa_ext_modules = kwargs['ext_modules']

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to