1.1 --- a/moinformat/tree/graphviz.py Tue Nov 27 21:17:34 2018 +0100
1.2 +++ b/moinformat/tree/graphviz.py Tue Nov 27 21:23:24 2018 +0100
1.3 @@ -25,17 +25,24 @@
1.4
1.5 "Format directive for Graphviz output."
1.6
1.7 - def __init__(self, key=None, value=None):
1.8 - self.key = key
1.9 - self.value = value
1.10 + def __init__(self, key=None, value=None, directive=None):
1.11 + self.directive = directive
1.12 +
1.13 + if key or value:
1.14 + self.key = key
1.15 + self.value = value
1.16 + else:
1.17 + t = directive.split(None, 1)
1.18 + self.key = t[0]
1.19 + self.value = len(t) > 1 and t[1] or None
1.20
1.21 def __repr__(self):
1.22 - return "Directive(%r, %r)" % (self.key, self.value)
1.23 + return "Directive(%r, %r, %r)" % (self.key, self.value, self.directive)
1.24
1.25 def prettyprint(self, indent=""):
1.26 - return "%sDirective: key=%r value=%r" % (indent, self.key, self.value)
1.27 + return "%sDirective: key=%r value=%r directive=%r" % (indent, self.key, self.value, self.directive)
1.28
1.29 def to_string(self, out):
1.30 - out.directive(self.key, self.value)
1.31 + out.directive(self.key, self.value, self.directive)
1.32
1.33 # vim: tabstop=4 expandtab shiftwidth=4