Titan Core Initial Contribution
[deliverable/titan.core.git] / etc / scripts / tpd_graph_xml2dot.py
1 ###############################################################################
2 # Copyright (c) 2000-2014 Ericsson Telecom AB
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Eclipse Public License v1.0
5 # which accompanies this distribution, and is available at
6 # http://www.eclipse.org/legal/epl-v10.html
7 ###############################################################################
8 import xml.etree.ElementTree as ET
9 tree = ET.parse('project_hierarchy_graph.xml')
10 root = tree.getroot()
11 f = open('project_hierarchy_graph.dot', 'w')
12 f.write("digraph PROJECT_HIERARCHY_GRAPH {\n")
13 for project in root:
14 for reference in project:
15 f.write(project.attrib['name'])
16 f.write(" -> ")
17 f.write(reference.attrib['name'])
18 f.write(";\n")
19 f.write("}\n")
20 f.close()
21
22 # use this to generate graph:
23 # > dot -Tpng project_hierarchy_graph.dot -o project_hierarchy_graph.png
This page took 0.031827 seconds and 6 git commands to generate.