Commit c4bd6d6a authored by Philipp Hörist's avatar Philipp Hörist Committed by Philipp Hörist
Browse files

Fix consider-iterating-dictionary pylint errors

parent 407dc04b
......@@ -188,7 +188,7 @@ def on_advanced_treeview_row_activated(self, treeview, path, column):
modelrow = self.model[modelpath]
option = modelrow[0]
if modelrow[2] == self.types['boolean']:
for key in self.right_true_dict.keys():
for key in self.right_true_dict:
if self.right_true_dict[key] == modelrow[1]:
modelrow[1] = str(key)
newval = {'False': True, 'True': False}[modelrow[1]]
......
......@@ -449,7 +449,7 @@ def get_number_of_securely_connected_accounts():
Return the number of the accounts that are SSL/TLS connected
"""
num_of_secured = 0
for account in connections.keys():
for account in connections:
if account_is_securely_connected(account):
num_of_secured += 1
return num_of_secured
......
......@@ -1008,7 +1008,7 @@ def get_notification_icon_tooltip_dict():
total_messages, total_messages, total_messages)
account['event_lines'].append(text)
else:
for jid in messages.keys():
for jid in messages:
text = ngettext(
'%d message pending',
'%d messages pending',
......@@ -1034,7 +1034,7 @@ def get_notification_icon_tooltip_dict():
total_non_messages, total_non_messages,total_non_messages)
account['event_lines'].append(text)
else:
for jid in non_messages.keys():
for jid in non_messages:
text = ngettext('%d event pending', '%d events pending',
non_messages[jid], non_messages[jid], non_messages[jid])
text += ' ' + _('from user %s') % (jid)
......
......@@ -294,7 +294,7 @@ def result_sha(self, sha_str, idx):
def activate_proxy(self, idx):
if not self.isHashInSockObjs(self.senders, idx):
return
for key in self.senders.keys():
for key in self.senders:
if idx in key:
sender = self.senders[key]
if sender.file_props.type_ != 's':
......
......@@ -89,7 +89,7 @@ def remove_service_callback(self, interface, protocol, name, stype, domain,
if not self.connected:
return
if name != self.name:
for key in self.contacts.keys():
for key in self.contacts:
val = self.contacts[key]
if val[Constant.BARE_NAME] == name:
# try to reduce instead of delete first
......
......@@ -98,7 +98,7 @@ def remove_service_callback(self, name):
if not self.connected:
return
if name != self.name:
for key in self.contacts.keys():
for key in self.contacts:
if self.contacts[key][Constant.NAME] == name:
del self.contacts[key]
self.remove_serviceCB(key)
......
......@@ -341,7 +341,7 @@ def _draw_table(self):
entry.grab_focus()
def get_infos(self):
for name in self.entries.keys():
for name in self.entries:
self.infos[name] = self.entries[name].get_text()
return self.infos
......@@ -390,7 +390,7 @@ def __init__(self, account, room_jid, form=None):
# Draw the edit affiliation list things
add_on_vbox = self.xml.get_object('add_on_vbox')
for affiliation in self.affiliation_labels.keys():
for affiliation in self.affiliation_labels:
self.start_users_dict[affiliation] = {}
hbox = Gtk.HBox(spacing=5)
add_on_vbox.pack_start(hbox, False, True, 0)
......@@ -539,7 +539,7 @@ def on_ok_button_clicked(self, widget):
form = self.data_form_widget.data_form
con = app.connections[self.account]
con.get_module('MUC').set_config(self.room_jid, form)
for affiliation in self.affiliation_labels.keys():
for affiliation in self.affiliation_labels:
users_dict = {}
actual_jid_list = []
model = self.affiliation_treeview[affiliation].get_model()
......
......@@ -352,7 +352,7 @@ def query_tooltip(self, widget, x_pos, y_pos, keyboard_mode, tooltip):
return False
def del_handlers(self):
for i in self.handlers.keys():
for i in self.handlers:
if self.handlers[i].handler_is_connected(i):
self.handlers[i].disconnect(i)
del self.handlers
......
......@@ -844,7 +844,7 @@ def fill_column(self, col):
col.add_attribute(rend[1], rend[3], rend[4])
col.set_cell_data_func(rend[1], rend[5], rend[6])
# set renderers properties
for renderer in self.renderers_propertys.keys():
for renderer in self.renderers_propertys:
renderer.set_property(self.renderers_propertys[renderer][0],
self.renderers_propertys[renderer][1])
......
......@@ -1107,7 +1107,7 @@ def _on_window_delete(self, win, event):
return False
def _on_window_destroy(self, win):
for k in self._windows.keys():
for k in self._windows:
if self._windows[k].window == win:
self.emit('window-delete', self._windows[k])
del self._windows[k]
......
......@@ -5545,7 +5545,7 @@ def fill_column(self, col):
col.add_attribute(rend[1], rend[3], rend[4])
col.set_cell_data_func(rend[1], rend[5], rend[6])
# set renderers properties
for renderer in self.renderers_propertys.keys():
for renderer in self.renderers_propertys:
renderer.set_property(self.renderers_propertys[renderer][0],
self.renderers_propertys[renderer][1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment