[Checkins] SVN: z3c.recipe.depgraph/branches/sdouche-exclude-eggs/ Added patch by Wouter Vanden Hove (add support for different file-formats).

Sébastien Douche sdouche at free.fr
Mon Nov 2 03:27:08 EST 2009


Log message for revision 105432:
  Added patch by Wouter Vanden Hove (add support for different file-formats).
  

Changed:
  U   z3c.recipe.depgraph/branches/sdouche-exclude-eggs/CHANGES.txt
  U   z3c.recipe.depgraph/branches/sdouche-exclude-eggs/README.txt
  U   z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/recipe.py
  U   z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/runner.py

-=-
Modified: z3c.recipe.depgraph/branches/sdouche-exclude-eggs/CHANGES.txt
===================================================================
--- z3c.recipe.depgraph/branches/sdouche-exclude-eggs/CHANGES.txt	2009-11-02 07:48:45 UTC (rev 105431)
+++ z3c.recipe.depgraph/branches/sdouche-exclude-eggs/CHANGES.txt	2009-11-02 08:27:08 UTC (rev 105432)
@@ -3,8 +3,15 @@
 
 0.4 (unreleased)
 ----------------
+- Added additional ``formats`` option, to control in which fileformats the output
+  is generated. [WouterVH]
 
+- Added additional ``re-exclude``, ``dead-ends`` and ``re-dead-ends`` options,
+  to control used eggs more precisely.
 
+- Added additional ``strict`` option, if you want graphs only for eggs 
+  in eggs option.
+
 0.3 (2009-07-23)
 ----------------
 

Modified: z3c.recipe.depgraph/branches/sdouche-exclude-eggs/README.txt
===================================================================
--- z3c.recipe.depgraph/branches/sdouche-exclude-eggs/README.txt	2009-11-02 07:48:45 UTC (rev 105431)
+++ z3c.recipe.depgraph/branches/sdouche-exclude-eggs/README.txt	2009-11-02 08:27:08 UTC (rev 105432)
@@ -13,6 +13,15 @@
 exclude
   A list of eggs which should be excluded from the graph processing.
 
+re-exclude
+  A list of eggs' regular expressions which should be excluded.
+
+dead-ends
+  A list of eggs which dependencies should be excluded.
+
+re-dead-ends
+  A list of eggs' regular expressions which dependencies should be excluded.
+
 extras
   A boolean determining if extra requirements should be included. Defaults
   to False.
@@ -23,8 +32,20 @@
 
 variants
   A whitespace separated list of variants of graphs to create. The available
-  options are:
+  options are::
 
     base - The basic full graphs.
     tred - The transitive reduction of the graphs.
     scc - Extracts graphs of strongly connected components.
+
+formats
+  A whitespace separated list of output-formats to create. Defaults to svg.
+  Please consult the manpages for the dot-command or visit the graphviz-website
+  for a full list_. Most commonly used options are::
+
+    svg - Scalable Vector Graphics
+    png - Portable Network Graphics
+    gif - Graphics Interchange Format
+
+
+ .. _list: http://www.graphviz.org/cvs/doc/info/output.html

Modified: z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/recipe.py
===================================================================
--- z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/recipe.py	2009-11-02 07:48:45 UTC (rev 105431)
+++ z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/recipe.py	2009-11-02 08:27:08 UTC (rev 105432)
@@ -40,6 +40,7 @@
                 self.buildout['buildout']['parts-directory'], self.name))
         extras = self.options.get('extras', 'false')
         self.extras = extras.lower() in ('1', 'true', 'yes')
+        self.formats = self.options.get('formats', 'svg').split()
 
     def install(self):
         options = self.options
@@ -51,6 +52,7 @@
         variants = options.get('variants', 'base tred scc')
         variants = [v.strip() for v in variants.split()]
 
+
         def matcher(names, patterns):
             names = set(names)
             matched_names = set()
@@ -96,6 +98,7 @@
                 name=self.name,
                 path=self.output,
                 variants=variants,
+                formats=self.formats,
                 extras=self.extras,
                 exclude = self.exclude,
                 re_exclude = self.re_exclude,

Modified: z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/runner.py
===================================================================
--- z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/runner.py	2009-11-02 07:48:45 UTC (rev 105431)
+++ z3c.recipe.depgraph/branches/sdouche-exclude-eggs/src/z3c/recipe/depgraph/runner.py	2009-11-02 08:27:08 UTC (rev 105432)
@@ -2,9 +2,9 @@
 
 GENERATE = "./bin/%(scriptname)s %(exclude)s %(re_exclude)s %(dead_ends)s %(re_dead_ends)s %(extras)s-d %(package)s -i setuptools > %(output)s"
 TRED = "tred %(input)s > %(output)s"
-GRAPH = "dot -Tsvg %(input)s > %(output)s"
+GRAPH = "dot -T%(format)s %(input)s > %(output)s"
 SCCMAP = "sccmap %(input)s > %(output)s"
-SCCGRAPH = "dot -Tsvg %(input)s -O"
+SCCGRAPH = "dot -T%(format)s %(input)s -O"
 
 
 def execute(template, **kwargs):
@@ -25,6 +25,7 @@
     path = args.get('path')
     scriptname = name + '-eggdeps'
     variants = args.get('variants', ['base', 'tred', 'scc'])
+    formats = args.get('formats', ['svg'])
     extras = args.get('extras')
     exclude = build_option('-i', args.get('exclude'))
     re_exclude = build_option('-I', args.get('re_exclude'))
@@ -56,23 +57,29 @@
             re_dead_ends=re_dead_ends,
             output=specfile + '.dot')
 
-        execute(GRAPH,
-            input=specfile + '.dot',
-            output=specfile + '.svg')
+        for format in formats:
+            execute(GRAPH,
+                format=format,
+                input=specfile + '.dot',
+                output=specfile + '.%s' % format)
 
         if 'tred' in variants:
             execute(TRED,
                 input=specfile + '.dot',
                 output=specfile + '-tred.dot')
 
-            execute(GRAPH,
-                input=specfile + '-tred.dot',
-                output=specfile + '-tred.svg')
+            for format in formats:
+                execute(GRAPH,
+                    format=format,
+                    input=specfile + '-tred.dot',
+                    output=specfile + '-tred.%s' % format)
 
         if 'scc' in variants:
             execute(SCCMAP,
                 input=specfile + '.dot',
                 output=specfile + '-sccmap')
 
-            execute(SCCGRAPH,
-                input=specfile + '-sccmap')
+            for format in formats:
+                execute(SCCGRAPH,
+                    format=format,
+                    input=specfile + '-sccmap')



More information about the checkins mailing list