Review at  https://gerrit.osmocom.org/7498

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
---
M contrib/fsm-to-dot.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/7498/1

diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 645b03c..a7135cb 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -532,7 +532,10 @@
         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:

-- 
To view, visit https://gerrit.osmocom.org/7498
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a10b615288107e8fc12ffdbbe0099cf51abe94f
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>

Reply via email to