You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/02/07 17:35:50 UTC
svn commit: r1241512 - /subversion/trunk/tools/dev/mergegraph/mergegraph.py
Author: julianfoad
Date: Tue Feb 7 16:35:50 2012
New Revision: 1241512
URL: http://svn.apache.org/viewvc?rev=1241512&view=rev
Log:
* tools/dev/mergegraph/mergegraph.py
(read_config): To simplify graph config files, supply a default output
filename based on the config file name; and make the title, merges and
annotations all optional.
Modified:
subversion/trunk/tools/dev/mergegraph/mergegraph.py
Modified: subversion/trunk/tools/dev/mergegraph/mergegraph.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/mergegraph/mergegraph.py?rev=1241512&r1=1241511&r2=1241512&view=diff
==============================================================================
--- subversion/trunk/tools/dev/mergegraph/mergegraph.py (original)
+++ subversion/trunk/tools/dev/mergegraph/mergegraph.py Tue Feb 7 16:35:50 2012
@@ -225,7 +225,15 @@ class MergeDot(MergeGraph, pydot.Dot):
def read_config(graph, config_filename):
"""Initialize a MergeDot graph's input data from a config file."""
import ConfigParser
- config = ConfigParser.SafeConfigParser()
+ if config_filename.endswith('.txt'):
+ default_filename = config_filename[:-4] + '.png'
+ else:
+ default_filename = config_filename + '.png'
+
+ config = ConfigParser.SafeConfigParser({ 'filename': default_filename,
+ 'title': None,
+ 'merges': '[]',
+ 'annotations': '[]' })
files_read = config.read(config_filename)
if len(files_read) == 0:
print >> sys.stderr, 'graph: unable to read graph config from "' + config_filename + '"'
@@ -281,6 +289,6 @@ class MergeDot(MergeGraph, pydot.Dot):
graph.add_annotation(node, label)
# A title for the graph (added last so it goes at the top)
- #if graph.title:
- # graph.add_node(Node('title', shape='plaintext', label='"' + graph.title + '"'))
+ if graph.title:
+ graph.add_node(Node('title', shape='plaintext', label='"' + graph.title + '"'))