contrib/fsm-to-dot: add default edge label '-'

When some edges have no label, it is sometimes hard to interpret which label
belongs to which edge. Adding a '-' default label clarifies the edge labeling.

Change-Id: I3a10b615288107e8fc12ffdbbe0099cf51abe94f
This commit is contained in:
Neels Hofmeyr 2018-03-25 03:08:28 +02:00 committed by Neels Hofmeyr
parent fcf79926e5
commit 75ee4e8aa9
1 changed files with 4 additions and 1 deletions

View File

@ -532,7 +532,10 @@ class Fsm:
if out_edge.actions:
labels.extend(out_edge.action_labels())
if labels:
attrs.append('label="%s"' % (r'\n'.join(labels)))
label = r'\n'.join(labels)
else:
label = '-'
attrs.append('label="%s"' % label)
if out_edge.style:
attrs.append('style=%s'% out_edge.style)
if out_edge.color: