[Checkins] SVN: z3c.recipe.depgraph/trunk/ Added a way to specify the graph variants to be created
Hanno Schlichting
plone at hannosch.info
Wed Apr 15 16:17:52 EDT 2009
Log message for revision 99204:
Added a way to specify the graph variants to be created
Changed:
U z3c.recipe.depgraph/trunk/README.txt
U z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/recipe.py
U z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/runner.py
-=-
Modified: z3c.recipe.depgraph/trunk/README.txt
===================================================================
--- z3c.recipe.depgraph/trunk/README.txt 2009-04-15 20:02:14 UTC (rev 99203)
+++ z3c.recipe.depgraph/trunk/README.txt 2009-04-15 20:17:52 UTC (rev 99204)
@@ -12,3 +12,11 @@
exclude
A list of eggs which should be excluded from the graph processing.
+
+variants
+ A whitespace separated list of variants of graphs to create. The available
+ options are:
+
+ base - The basic full graphs.
+ tred - The transitive reduction of the graphs.
+ scc - Extracts graphs of strongly connected components.
Modified: z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/recipe.py
===================================================================
--- z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/recipe.py 2009-04-15 20:02:14 UTC (rev 99203)
+++ z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/recipe.py 2009-04-15 20:17:52 UTC (rev 99204)
@@ -34,6 +34,9 @@
if not os.path.exists(self.output):
os.mkdir(self.output)
+ variants = options.get('variants', 'base tred scc')
+ variants = [v.strip() for v in variants.split()]
+
# Install an interpreter
packages = set(ws.by_key.keys()) - EXCLUDE_PACKAGES - self.exclude
packages = list(packages)
@@ -41,7 +44,12 @@
easy_install.scripts(
[('graph-%s' % self.name, 'z3c.recipe.depgraph.runner', 'main')],
ws, options['executable'], options['bin-directory'],
- arguments=dict(packages=packages, name=self.name, path=self.output),
+ arguments=dict(
+ packages=packages,
+ name=self.name,
+ path=self.output,
+ variants=variants
+ ),
)
reqs = ['tl.eggdeps']
Modified: z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/runner.py
===================================================================
--- z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/runner.py 2009-04-15 20:02:14 UTC (rev 99203)
+++ z3c.recipe.depgraph/trunk/src/z3c/recipe/depgraph/runner.py 2009-04-15 20:17:52 UTC (rev 99204)
@@ -19,6 +19,7 @@
packages = args.get('packages')
path = args.get('path')
scriptname = name + '-eggdeps'
+ variants = args.get('variants', ['base', 'tred', 'scc'])
for package in packages:
package = PACKAGE_EXCEPTIONS.get(package, package)
@@ -37,17 +38,19 @@
input=specfile + '.dot',
output=specfile + '.svg')
- execute(TRED,
- input=specfile + '.dot',
- output=specfile + '-tred.dot')
+ if 'tred' in variants:
+ execute(TRED,
+ input=specfile + '.dot',
+ output=specfile + '-tred.dot')
- execute(GRAPH,
- input=specfile + '-tred.dot',
- output=specfile + '-tred.svg')
+ execute(GRAPH,
+ input=specfile + '-tred.dot',
+ output=specfile + '-tred.svg')
- execute(SCCMAP,
- input=specfile + '.dot',
- output=specfile + '-sccmap')
+ if 'scc' in variants:
+ execute(SCCMAP,
+ input=specfile + '.dot',
+ output=specfile + '-sccmap')
- execute(SCCGRAPH,
- input=specfile + '-sccmap')
+ execute(SCCGRAPH,
+ input=specfile + '-sccmap')
More information about the Checkins
mailing list