[roidelapluie] coding standards. see #253
This commit is contained in:
parent
680088ea2f
commit
86eb5f7120
2 changed files with 11 additions and 12 deletions
|
@ -2335,7 +2335,7 @@ class BlockedContactsWindow:
|
||||||
tags = []
|
tags = []
|
||||||
rule_selected = self.store.get_path(
|
rule_selected = self.store.get_path(
|
||||||
self.contacts_treeview.get_selection().get_selected()[1])[0]
|
self.contacts_treeview.get_selection().get_selected()[1])[0]
|
||||||
for i in range(0,len(self.global_rules)):
|
for i in range(0, len(self.global_rules)):
|
||||||
if i != rule_selected:
|
if i != rule_selected:
|
||||||
tags.append(self.global_rules[i])
|
tags.append(self.global_rules[i])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1429,15 +1429,15 @@ class RosterWindow:
|
||||||
self.dialog = dialogs.ConfirmationDialog(pritext, sectext,
|
self.dialog = dialogs.ConfirmationDialog(pritext, sectext,
|
||||||
on_response_ok = (remove, list_))
|
on_response_ok = (remove, list_))
|
||||||
|
|
||||||
def on_block(self, widget, iter, blockedlist):
|
def on_block(self, widget, iter, group_list):
|
||||||
''' When clicked on the 'block' button in context menu. '''
|
''' When clicked on the 'block' button in context menu. '''
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
accounts = []
|
accounts = []
|
||||||
if blockedlist == None:
|
msg = self.get_status_message('offline')
|
||||||
|
if group_list == None:
|
||||||
jid = model[iter][C_JID].decode('utf-8')
|
jid = model[iter][C_JID].decode('utf-8')
|
||||||
account = model[iter][C_ACCOUNT].decode('utf-8')
|
account = model[iter][C_ACCOUNT].decode('utf-8')
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
msg = self.get_status_message('offline')
|
|
||||||
self.send_status(account, 'offline', msg, to = jid)
|
self.send_status(account, 'offline', msg, to = jid)
|
||||||
new_rule = {'order': u'1', 'type': u'jid', 'action': u'deny',
|
new_rule = {'order': u'1', 'type': u'jid', 'action': u'deny',
|
||||||
'value' : jid, 'child': [u'message', u'iq', u'presence-out']}
|
'value' : jid, 'child': [u'message', u'iq', u'presence-out']}
|
||||||
|
@ -1446,14 +1446,13 @@ class RosterWindow:
|
||||||
gajim.connections[account].blocked_contacts.append(jid)
|
gajim.connections[account].blocked_contacts.append(jid)
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
else:
|
else:
|
||||||
msg = self.get_status_message('offline')
|
|
||||||
if iter == None:
|
if iter == None:
|
||||||
for (contact, account) in blockedlist:
|
for (contact, account) in group_list:
|
||||||
if account not in accounts:
|
if account not in accounts:
|
||||||
if not gajim.connections[account].privacy_rules_supported:
|
if not gajim.connections[account].privacy_rules_supported:
|
||||||
continue
|
continue
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
self.send_status(account, 'offline', msg, to = contact.jid)
|
self.send_status(account, 'offline', msg, to=contact.jid)
|
||||||
new_rule = {'order': u'1', 'type': u'jid',
|
new_rule = {'order': u'1', 'type': u'jid',
|
||||||
'action': u'deny', 'value' : contact.jid,
|
'action': u'deny', 'value' : contact.jid,
|
||||||
'child': [u'message', u'iq', u'presence-out']}
|
'child': [u'message', u'iq', u'presence-out']}
|
||||||
|
@ -1464,12 +1463,12 @@ class RosterWindow:
|
||||||
else:
|
else:
|
||||||
group = model[iter][C_JID].decode('utf-8')
|
group = model[iter][C_JID].decode('utf-8')
|
||||||
msg = self.get_status_message('offline')
|
msg = self.get_status_message('offline')
|
||||||
for (contact, account) in blockedlist:
|
for (contact, account) in group_list:
|
||||||
if account not in accounts:
|
if account not in accounts:
|
||||||
if not gajim.connections[account].privacy_rules_supported:
|
if not gajim.connections[account].privacy_rules_supported:
|
||||||
continue
|
continue
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
self.send_status(account, 'offline', msg, to = contact.jid)
|
self.send_status(account, 'offline', msg, to=contact.jid)
|
||||||
# needed for draw_contact:
|
# needed for draw_contact:
|
||||||
gajim.connections[account].blocked_contacts.append(contact.jid)
|
gajim.connections[account].blocked_contacts.append(contact.jid)
|
||||||
self.draw_contact(contact.jid, account)
|
self.draw_contact(contact.jid, account)
|
||||||
|
@ -1560,7 +1559,7 @@ class RosterWindow:
|
||||||
show = gajim.SHOW_LIST[status]
|
show = gajim.SHOW_LIST[status]
|
||||||
else: # accounts merged
|
else: # accounts merged
|
||||||
show = helpers.get_global_show()
|
show = helpers.get_global_show()
|
||||||
self.send_status(jid_account, show, msg, to = jid)
|
self.send_status(jid_account, show, msg, to=jid)
|
||||||
else:
|
else:
|
||||||
for (contact, account) in group_list:
|
for (contact, account) in group_list:
|
||||||
if not self.regroup:
|
if not self.regroup:
|
||||||
|
@ -1571,10 +1570,10 @@ class RosterWindow:
|
||||||
if gajim.connections[account].privacy_rules_supported:
|
if gajim.connections[account].privacy_rules_supported:
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
self.send_status(account, show,
|
self.send_status(account, show,
|
||||||
gajim.connections[account].status, to = contact.jid)
|
gajim.connections[account].status, to=contact.jid)
|
||||||
else:
|
else:
|
||||||
self.send_status(account, show,
|
self.send_status(account, show,
|
||||||
gajim.connections[account].status, to = contact.jid)
|
gajim.connections[account].status, to=contact.jid)
|
||||||
|
|
||||||
def on_rename(self, widget, iter, path):
|
def on_rename(self, widget, iter, path):
|
||||||
# this function is called either by F2 or by Rename menuitem
|
# this function is called either by F2 or by Rename menuitem
|
||||||
|
|
Loading…
Add table
Reference in a new issue