From 6acb3dc53fbf1ce1835673b8df6647421416df4d Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Sat, 18 Mar 2017 19:26:12 +0100 Subject: rumba: avoid dict.items to ease portability across Python versions --- rumba/model.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rumba/model.py b/rumba/model.py index 19c1182..2337d19 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -175,7 +175,8 @@ class Node: s += " DIF registrations: [ " rl = [] - for dif_a, difs in self.dif_registrations.items(): + for dif_a in self.dif_registrations: + difs = self.dif_registrations[dif_a] x = "%s => [" % dif_a.name x += " ".join([dif_b.name for dif_b in difs]) x += "]" @@ -184,14 +185,16 @@ class Node: s += " ]\n" s += " Name registrations: [ " - for name, difs in self.registrations.items(): + for name in self.registrations: + difs = self.registrations[name] s += "%s => [ " % name - s += " ".join([dif.name for dif in difs]) + s += ", ".join([dif.name for dif in difs]) s += " ]" s += " ]\n" s += " Bindings: [ " - s += ", ".join(["'%s' => '%s'" % (ap, name) for ap, name in self.bindings.items()]) + s += ", ".join(["'%s' => '%s'" % (ap, self.bindings[ap]) \ + for ap in self.bindings]) s += " ]\n" return s -- cgit v1.2.3