[Checkins]
SVN: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/
rename 'include' module to 'dependency'
Ethan Jucovy
ejucovy at openplans.org
Fri Mar 28 14:25:18 EDT 2008
Log message for revision 85003:
rename 'include' module to 'dependency'
Changed:
U z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/README.txt
U z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/__init__.py
A z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/dependency.py
D z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/include.py
U z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/plugin.py
U z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/zcml.py
-=-
Modified: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/README.txt
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/README.txt 2008-03-28 17:14:37 UTC (rev 85002)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/README.txt 2008-03-28 18:25:18 UTC (rev 85003)
@@ -29,7 +29,7 @@
Automatic inclusion of package dependencies
===========================================
-The z3c.autoinclude.include module uses an egg's install_requires
+The z3c.autoinclude.dependency module uses an egg's install_requires
information (in the project's setup.py) to find and implicitly load
zcml from all dependencies of a project.
@@ -90,7 +90,7 @@
We can adapt a distribution to an IncludeFinder::
- >>> from z3c.autoinclude.include import IncludeFinder
+ >>> from z3c.autoinclude.dependency import IncludeFinder
>>> a_include_finder = IncludeFinder(a_dist)
>>> b_include_finder = IncludeFinder(b_dist)
>>> xyz_include_finder = IncludeFinder(xyz_dist)
Modified: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/__init__.py
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/__init__.py 2008-03-28 17:14:37 UTC (rev 85002)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/__init__.py 2008-03-28 18:25:18 UTC (rev 85003)
@@ -1,2 +1,2 @@
#
-from include import package_includes
+from dependency import package_includes
Copied: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/dependency.py (from rev 84925, z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/include.py)
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/dependency.py (rev 0)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/dependency.py 2008-03-28 18:25:18 UTC (rev 85003)
@@ -0,0 +1,43 @@
+import os
+from zope.dottedname.resolve import resolve
+from pkg_resources import resource_exists
+from pkg_resources import get_provider
+from pkg_resources import get_distribution
+import logging
+from z3c.autoinclude.utils import DistributionManager
+
+log = logging.getLogger("z3c.autoinclude")
+
+class IncludeFinder(DistributionManager):
+ def includableInfo(self, include_candidates):
+ """Return the packages in the dependencies which are includable.
+
+ include_candidates - a list of include files we are looking for
+
+ Returns a dictionary with the include candidates as keys, and lists
+ of dotted names of packages that contain the include candidates as
+ values.
+ """
+ result = {}
+ for req in self.context.requires():
+ dist_manager = DistributionManager(get_provider(req))
+ for dotted_name in dist_manager.dottedNames():
+ module = resolve(dotted_name)
+ for candidate in include_candidates:
+ candidate_path = os.path.join(
+ os.path.dirname(module.__file__), candidate)
+ if os.path.isfile(candidate_path):
+ result.setdefault(candidate, []).append(dotted_name)
+ return result
+
+def package_includes(project_name, zcml_filenames=None):
+ """
+ Convenience function for finding zcml to load from requirements for
+ a given project. Takes a project name. DistributionNotFound errors
+ will be raised for uninstalled projects.
+ """
+ if zcml_filenames is None:
+ zcml_filenames = ['meta.zcml', 'configure.zcml', 'overrides.zcml']
+ dist = get_distribution(project_name)
+ include_finder = IncludeFinder(dist)
+ return include_finder.includableInfo(zcml_filenames)
Deleted: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/include.py
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/include.py 2008-03-28 17:14:37 UTC (rev 85002)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/include.py 2008-03-28 18:25:18 UTC (rev 85003)
@@ -1,43 +0,0 @@
-import os
-from zope.dottedname.resolve import resolve
-from pkg_resources import resource_exists
-from pkg_resources import get_provider
-from pkg_resources import get_distribution
-import logging
-from z3c.autoinclude.utils import DistributionManager
-
-log = logging.getLogger("z3c.autoinclude")
-
-class IncludeFinder(DistributionManager):
- def includableInfo(self, include_candidates):
- """Return the packages in the dependencies which are includable.
-
- include_candidates - a list of include files we are looking for
-
- Returns a dictionary with the include candidates as keys, and lists
- of dotted names of packages that contain the include candidates as
- values.
- """
- result = {}
- for req in self.context.requires():
- dist_manager = DistributionManager(get_provider(req))
- for dotted_name in dist_manager.dottedNames():
- module = resolve(dotted_name)
- for candidate in include_candidates:
- candidate_path = os.path.join(
- os.path.dirname(module.__file__), candidate)
- if os.path.isfile(candidate_path):
- result.setdefault(candidate, []).append(dotted_name)
- return result
-
-def package_includes(project_name, zcml_filenames=None):
- """
- Convenience function for finding zcml to load from requirements for
- a given project. Takes a project name. DistributionNotFound errors
- will be raised for uninstalled projects.
- """
- if zcml_filenames is None:
- zcml_filenames = ['meta.zcml', 'configure.zcml', 'overrides.zcml']
- dist = get_distribution(project_name)
- include_finder = IncludeFinder(dist)
- return include_finder.includableInfo(zcml_filenames)
Modified: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/plugin.py
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/plugin.py 2008-03-28 17:14:37 UTC (rev 85002)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/plugin.py 2008-03-28 18:25:18 UTC (rev 85003)
@@ -1,7 +1,7 @@
import os
from pkg_resources import iter_entry_points
from pkg_resources import resource_filename
-from z3c.autoinclude.include import IncludeFinder
+from z3c.autoinclude.dependency import IncludeFinder
from z3c.autoinclude.utils import DistributionManager
from z3c.autoinclude.utils import distributionForDottedName
Modified: z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/zcml.py
===================================================================
--- z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/zcml.py 2008-03-28 17:14:37 UTC (rev 85002)
+++ z3c.autoinclude/branches/adding-salt/src/z3c/autoinclude/zcml.py 2008-03-28 18:25:18 UTC (rev 85003)
@@ -3,7 +3,7 @@
from zope.configuration.fields import GlobalObject
from zope.dottedname.resolve import resolve
-from z3c.autoinclude.include import IncludeFinder
+from z3c.autoinclude.dependency import IncludeFinder
from z3c.autoinclude.utils import debug_includes
from z3c.autoinclude.utils import distributionForPackage
from z3c.autoinclude.plugin import PluginFinder
More information about the Checkins
mailing list