From b566e4bcd0c7cb3c90ad941b37db223134090ded Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 8 May 2009 23:07:25 +0200 Subject: * tools/dfagen: - added state attributes. - added support for more than one initial state. - added table of transitions with only one default branch. - added state and event template parameter. - added --output-dir. - make template directory relative to config file. - more options checking. - added transition attributes and callback definition. - conserve input file order in output. - added --dump and more option checking. - fixed missing newline. --- tools/dfagen/dfagen/output/dot.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools/dfagen/dfagen/output/dot.py') diff --git a/tools/dfagen/dfagen/output/dot.py b/tools/dfagen/dfagen/output/dot.py index d6cc057c..ce9c4db8 100644 --- a/tools/dfagen/dfagen/output/dot.py +++ b/tools/dfagen/dfagen/output/dot.py @@ -1,12 +1,13 @@ +import os.path -def write (prefix, automaton, user): +def write (prefix, automaton, user, outputdir): output = prefix + '.dot' - o = open (output, 'w') + o = open (os.path.join (outputdir, output), 'w') o.write ('digraph %s {' % prefix) - for s in automaton.states.values (): + for s in automaton.iter_states (): o.write (' %s\n' % s.name) - for tr in s.transitions.values (): - for br in tr.branches.values (): + for tr in s.iter_transitions (): + for br in tr.iter_branches (): o.write (' %(state)s -> %(to)s [ label = "%(event)s" ];\n' % dict ( state = s.name, -- cgit v1.2.3