Commits

Nozomu Kaneko committed d68ed12

Added support for multiple addresses.
Now a node may have multiple addresses in a network.

Comments (0)

Files changed (1)

src/nwdiag/elements.py

     def set_attributes(self, network, attrs):
         for attr in attrs:
             if attr.name == 'address':
-                self.address[network] = unquote(attr.value)
+                if network in self.address:
+                    s = self.address[network]
+                    if s:
+                        s += "\n"
+                else:
+                    s = ""
+                self.address[network] = s + unquote(attr.value)
             else:
                 self.set_attribute(attr)