[Checkins] SVN: z3c.recipe.autoinclude/trunk/ revert 'Fixed dependency order' patch
Nikolay Kim
fafhrd91 at gmail.com
Sat Mar 20 16:38:22 EDT 2010
Log message for revision 110094:
revert 'Fixed dependency order' patch
Changed:
U z3c.recipe.autoinclude/trunk/CHANGES.txt
U z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py
-=-
Modified: z3c.recipe.autoinclude/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.autoinclude/trunk/CHANGES.txt 2010-03-20 15:38:21 UTC (rev 110093)
+++ z3c.recipe.autoinclude/trunk/CHANGES.txt 2010-03-20 20:38:22 UTC (rev 110094)
@@ -2,12 +2,7 @@
CHANGES
=======
-0.2.2 (2009-01-18)
-------------------
-- Fixed dependency order (Takayuki Shimizukawa)
-
-
0.2.1 (2010-01-15)
------------------
Modified: z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py
===================================================================
--- z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py 2010-03-20 15:38:21 UTC (rev 110093)
+++ z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py 2010-03-20 20:38:22 UTC (rev 110094)
@@ -22,6 +22,7 @@
result = []
for ns_path in ns_paths:
path = os.path.join(dist_path, ns_path)
+
subpackages = subpackageDottedNames(path, ns_path)
for subpackage in subpackages:
if subpackage not in ns_paths:
@@ -30,7 +31,7 @@
def includableInfo(self, zcml_to_look_for, seen=None):
result = dict([(key, []) for key in zcml_to_look_for])
-
+
if seen is None:
seen = set()
@@ -40,7 +41,7 @@
for req in self.context.requires():
pkg = req.project_name
- if pkg.startswith('zope.app.') or pkg in ('zope.formlib',):
+ if pkg.startswith('zope.app.') or pkg in ('zope.formlib', 'z3ext.resource'):
global deps
d = deps[1].setdefault(self.context.project_name, [])
if pkg not in d:
@@ -50,8 +51,7 @@
if self.context.project_name not in d:
d.append(self.context.project_name)
-
- if pkg == 'setuptools':
+ if pkg in seen or pkg == 'setuptools':
continue
# get info from requirenments
@@ -59,41 +59,28 @@
if dist is None:
continue
- if pkg in seen:
- result = add_context_to_result(
- DependencyFinder(dist, self.ws),
- result, zcml_to_look_for, True)
+ info = DependencyFinder(
+ self.ws.find(req), self.ws).includableInfo(zcml_to_look_for, seen)
- else:
- info = DependencyFinder(
- self.ws.find(req), self.ws).includableInfo(zcml_to_look_for, seen)
+ for key, items in info.items():
+ data = result[key]
+ for item in items:
+ if item not in data:
+ data.append(item)
- for key, items in info.items():
- data = result[key]
- for item in items:
- if item not in data:
- data.append(item)
+ # get info for self
+ for path in self.paths():
+ for candidate in zcml_to_look_for:
+ candidate_path = os.path.join(
+ self.context.location, path, candidate)
- return add_context_to_result(self, result, zcml_to_look_for)
-
-
-def add_context_to_result(self, result, zcml_to_look_for, precede=False):
- # get info for context
- for path in self.paths():
- for candidate in zcml_to_look_for:
- candidate_path = os.path.join(
- self.context.location, path, candidate)
-
- if os.path.isfile(candidate_path):
- name = path.replace(os.path.sep, '.')
- if name not in result[candidate]:
+ if os.path.isfile(candidate_path):
+ name = path.replace(os.path.sep, '.')
result[candidate].append(name)
- elif precede:
- result[candidate].remove(name)
- result[candidate].insert(0, name)
- return result
+ return result
+
def subpackageDottedNames(package_path, ns_path=None):
# we do not look for subpackages in zipped eggs
if not os.path.isdir(package_path):
More information about the checkins
mailing list