aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-03-18 19:26:12 +0100
committerVincenzo Maffione <v.maffione@gmail.com>2017-03-18 19:26:12 +0100
commit6acb3dc53fbf1ce1835673b8df6647421416df4d (patch)
treeb309c624b6b391291d05f18754804583036affc1
parentf9a1c59b35931fc55cc9d09385c0c127c2e7e1d4 (diff)
downloadrumba-6acb3dc53fbf1ce1835673b8df6647421416df4d.tar.gz
rumba-6acb3dc53fbf1ce1835673b8df6647421416df4d.zip
rumba: avoid dict.items to ease portability across Python versions
-rw-r--r--rumba/model.py11
1 files 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