[Zope3-checkins] CVS: Zope3/utilities - finddeps.py:1.6
Fred L. Drake, Jr.
fred at zope.com
Thu Mar 11 12:19:09 EST 2004
Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv20325
Modified Files:
finddeps.py
Log Message:
- wrap some long lines
- normalize whitespace
=== Zope3/utilities/finddeps.py 1.5 => 1.6 ===
--- Zope3/utilities/finddeps.py:1.5 Thu Mar 11 12:17:07 2004
+++ Zope3/utilities/finddeps.py Thu Mar 11 12:19:08 2004
@@ -15,7 +15,7 @@
"""Script to determine the dependencies of a package or module
This script walks through the modules of a package or only observes a
-file-based module to determine its dependencies.
+file-based module to determine its dependencies.
Usage: finddeps.py [options]
Options:
@@ -62,7 +62,7 @@
def __init__(self, path, file, lineno):
self.path = path
- self.occurences = [(file, lineno)]
+ self.occurences = [(file, lineno)]
def addOccurence(self, file, lineno):
"""Add occurenace of the dependency in the code."""
@@ -83,7 +83,7 @@
def __cmp__(self, other):
"""Compare dependecies by path."""
return cmp(self.path, other.path)
-
+
def usage(code, msg=''):
"""Display help."""
@@ -104,7 +104,7 @@
return dottedPath
raise ValueError, 'Cannot create dotted path.'
-
+
def getDependenciesOfPythonFile(path):
"""Look through a file for dependencies."""
@@ -130,11 +130,12 @@
match[0] = match[0][1:-1]
match.append('.'.join(match[0].split('.')[:-1]))
- # zope and zope.app shoudl never be dependencies; they are too general
+ # zope and zope.app should never be dependencies; they are
+ # too general
if 'zope' in match:
match.remove('zope')
if 'zope.app' in match:
- match.remove('zope.app')
+ match.remove('zope.app')
for name in match:
if name.startswith('.'):
@@ -143,7 +144,7 @@
__import__(name)
except:
continue
- deps.append(Dependency(name, path, lineno))
+ deps.append(Dependency(name, path, lineno))
return deps
@@ -154,7 +155,7 @@
basically containers.
"""
filteredDeps = []
- for dep in deps:
+ for dep in deps:
try:
module = __import__(dep.path)
except ImportError:
@@ -179,7 +180,8 @@
for dep in deps:
module = dep.path.split('.')[0]
modulePath = os.path.join(path, module)
- if not (os.path.exists(modulePath) or os.path.exists(modulePath+'.py')):
+ if not (os.path.exists(modulePath)
+ or os.path.exists(modulePath+'.py')):
filteredDeps.append(dep)
deps = filteredDeps
@@ -261,7 +263,7 @@
# zope and zope/app are too general to be considered.
if path.endswith('src/zope/') or path.endswith('src/zope/app/'):
return deps
-
+
if deps is None:
deps = []
paths = []
More information about the Zope3-Checkins
mailing list