# HG changeset patch # User Paul Boddie # Date 1543349854 -3600 # Node ID 7e64312c88a7a2177fd935b941b16aee353bcccf # Parent dcdee3b1a6508f6f9324e4a079ba13ed5c44159b Handle missing directive values and employ standard Moin syntax when formatting. diff -r dcdee3b1a650 -r 7e64312c88a7 moinformat/parsers/graphviz.py --- a/moinformat/parsers/graphviz.py Tue Nov 27 21:13:04 2018 +0100 +++ b/moinformat/parsers/graphviz.py Tue Nov 27 21:17:34 2018 +0100 @@ -45,7 +45,9 @@ directive = self.match_group("directive") if directive: - key, value = directive.split(None, 1) + t = directive.split(None, 1) + key = t[0] + value = len(t) > 1 and t[1] or None else: key = self.match_group("key") value = self.match_group("value") diff -r dcdee3b1a650 -r 7e64312c88a7 moinformat/serialisers/moin/graphviz.py --- a/moinformat/serialisers/moin/graphviz.py Tue Nov 27 21:13:04 2018 +0100 +++ b/moinformat/serialisers/moin/graphviz.py Tue Nov 27 21:17:34 2018 +0100 @@ -32,7 +32,7 @@ pass def directive(self, key, value): - self.out("//%s%s\n" % (value and "%s=" % key or key, value or "")) + self.out("#%s%s\n" % (value and "%s " % key or key, value or "")) def text(self, text): self.out(text)