Replace iteritems() by items()

This commit is contained in:
Sebastien Helleu 2011-12-24 12:38:55 +01:00
parent 35125a392d
commit 773ee7bb73
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ class MainWindow(QtGui.QMainWindow):
'quit' : ['application-exit.png', 'Quit application', 'Ctrl+Q', self.close],
}
self.actions = {}
for name, action in actions_def.iteritems():
for name, action in list(actions_def.items()):
self.actions[name] = QtGui.QAction(QtGui.QIcon('data/icons/%s' % action[0]), name.capitalize(), self)
self.actions[name].setStatusTip(action[1])
self.actions[name].setShortcut(action[2])

View File

@ -49,14 +49,14 @@ class WeechatObject:
' path: %s' % str(self.value['path'])]
for i, item in enumerate(self.value['items']):
lines.append(' item %d:' % (i + 1))
lines.append('\n'.join([' %s: %s' % (key, self._str_value(value)) for key, value in iter(sorted(item.iteritems()))]))
lines.append('\n'.join([' %s: %s' % (key, self._str_value(value)) for key, value in sorted(item.items())]))
return '\n'.join(lines)
def _str_value_infolist(self):
lines = ['', ' name: %s' % self.value['name']]
for i, item in enumerate(self.value['items']):
lines.append(' item %d:' % (i + 1))
lines.append('\n'.join([' %s: %s' % (key, self._str_value(value)) for key, value in iter(sorted(item.iteritems()))]))
lines.append('\n'.join([' %s: %s' % (key, self._str_value(value)) for key, value in sorted(item.items())]))
return '\n'.join(lines)
def _str_value_other(self):