Replace iteritems() by items()
This commit is contained in:
parent
35125a392d
commit
773ee7bb73
2 changed files with 3 additions and 3 deletions
|
@ -98,7 +98,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||||
'quit' : ['application-exit.png', 'Quit application', 'Ctrl+Q', self.close],
|
'quit' : ['application-exit.png', 'Quit application', 'Ctrl+Q', self.close],
|
||||||
}
|
}
|
||||||
self.actions = {}
|
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] = QtGui.QAction(QtGui.QIcon('data/icons/%s' % action[0]), name.capitalize(), self)
|
||||||
self.actions[name].setStatusTip(action[1])
|
self.actions[name].setStatusTip(action[1])
|
||||||
self.actions[name].setShortcut(action[2])
|
self.actions[name].setShortcut(action[2])
|
||||||
|
|
|
@ -49,14 +49,14 @@ class WeechatObject:
|
||||||
' path: %s' % str(self.value['path'])]
|
' path: %s' % str(self.value['path'])]
|
||||||
for i, item in enumerate(self.value['items']):
|
for i, item in enumerate(self.value['items']):
|
||||||
lines.append(' item %d:' % (i + 1))
|
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)
|
return '\n'.join(lines)
|
||||||
|
|
||||||
def _str_value_infolist(self):
|
def _str_value_infolist(self):
|
||||||
lines = ['', ' name: %s' % self.value['name']]
|
lines = ['', ' name: %s' % self.value['name']]
|
||||||
for i, item in enumerate(self.value['items']):
|
for i, item in enumerate(self.value['items']):
|
||||||
lines.append(' item %d:' % (i + 1))
|
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)
|
return '\n'.join(lines)
|
||||||
|
|
||||||
def _str_value_other(self):
|
def _str_value_other(self):
|
||||||
|
|
Loading…
Reference in a new issue