Honor coding standards
This commit is contained in:
parent
fb273aeadf
commit
a707eaa050
|
@ -63,7 +63,6 @@ if dbus_support.supported:
|
||||||
import dbus
|
import dbus
|
||||||
from lastfm_track_listener import LastFMTrackListener
|
from lastfm_track_listener import LastFMTrackListener
|
||||||
|
|
||||||
import sys
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
from osx import syncmenu
|
from osx import syncmenu
|
||||||
|
|
||||||
|
@ -257,7 +256,7 @@ class RosterWindow:
|
||||||
'show_contacts_number'):
|
'show_contacts_number'):
|
||||||
nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts(
|
nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts(
|
||||||
accounts = accounts)
|
accounts = accounts)
|
||||||
account_name += ' (%s/%s)' % (repr(nbr_on),repr(nbr_total))
|
account_name += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total))
|
||||||
model[iter][C_NAME] = account_name
|
model[iter][C_NAME] = account_name
|
||||||
|
|
||||||
def remove_newly_added(self, jid, account):
|
def remove_newly_added(self, jid, account):
|
||||||
|
@ -1245,7 +1244,8 @@ class RosterWindow:
|
||||||
item.connect('activate', self.on_join_gc_activate, account)
|
item.connect('activate', self.on_join_gc_activate, account)
|
||||||
gc_sub_menu.append(item)
|
gc_sub_menu.append(item)
|
||||||
|
|
||||||
if len(gajim.connections[account].bookmarks) > 0: # user has at least one bookmark
|
# user has at least one bookmark
|
||||||
|
if len(gajim.connections[account].bookmarks) > 0:
|
||||||
item = gtk.SeparatorMenuItem() # separator
|
item = gtk.SeparatorMenuItem() # separator
|
||||||
gc_sub_menu.append(item)
|
gc_sub_menu.append(item)
|
||||||
|
|
||||||
|
@ -3342,7 +3342,6 @@ class RosterWindow:
|
||||||
model, list_of_paths = self.tree.get_selection().get_selected_rows()
|
model, list_of_paths = self.tree.get_selection().get_selected_rows()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
list_of_paths = []
|
list_of_paths = []
|
||||||
pass
|
|
||||||
if path not in list_of_paths:
|
if path not in list_of_paths:
|
||||||
self.tree.get_selection().unselect_all()
|
self.tree.get_selection().unselect_all()
|
||||||
self.tree.get_selection().select_path(path)
|
self.tree.get_selection().select_path(path)
|
||||||
|
@ -3353,7 +3352,6 @@ class RosterWindow:
|
||||||
model, list_of_paths = self.tree.get_selection().get_selected_rows()
|
model, list_of_paths = self.tree.get_selection().get_selected_rows()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
list_of_paths = []
|
list_of_paths = []
|
||||||
pass
|
|
||||||
if list_of_paths != [path]:
|
if list_of_paths != [path]:
|
||||||
self.tree.get_selection().unselect_all()
|
self.tree.get_selection().unselect_all()
|
||||||
self.tree.get_selection().select_path(path)
|
self.tree.get_selection().select_path(path)
|
||||||
|
@ -3404,8 +3402,8 @@ class RosterWindow:
|
||||||
# We just save on which row we press button, and open chat window on
|
# We just save on which row we press button, and open chat window on
|
||||||
# button release to be able to do DND without opening chat window
|
# button release to be able to do DND without opening chat window
|
||||||
self.clicked_path = path
|
self.clicked_path = path
|
||||||
return
|
|
||||||
self.on_row_activated(widget, path)
|
self.on_row_activated(widget, path)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
if type_ == 'group' and x < 27:
|
if type_ == 'group' and x < 27:
|
||||||
# first cell in 1st column (the arrow SINGLE clicked)
|
# first cell in 1st column (the arrow SINGLE clicked)
|
||||||
|
@ -3508,7 +3506,8 @@ class RosterWindow:
|
||||||
text = _('Enter your password for account %s') % account
|
text = _('Enter your password for account %s') % account
|
||||||
if passwords.USER_HAS_GNOMEKEYRING and \
|
if passwords.USER_HAS_GNOMEKEYRING and \
|
||||||
not passwords.USER_USES_GNOMEKEYRING:
|
not passwords.USER_USES_GNOMEKEYRING:
|
||||||
text += '\n' + _('Gnome Keyring is installed but not correctly started (environment variable probably not correctly set)')
|
text += '\n' + _('Gnome Keyring is installed but not correctly started\
|
||||||
|
(environment variable probably not correctly set)')
|
||||||
w = dialogs.PassphraseDialog(_('Password Required'), text,
|
w = dialogs.PassphraseDialog(_('Password Required'), text,
|
||||||
_('Save password'))
|
_('Save password'))
|
||||||
passphrase, save = w.run()
|
passphrase, save = w.run()
|
||||||
|
@ -3639,9 +3638,9 @@ class RosterWindow:
|
||||||
self.update_status_combobox()
|
self.update_status_combobox()
|
||||||
return
|
return
|
||||||
status = model[active][2].decode('utf-8')
|
status = model[active][2].decode('utf-8')
|
||||||
statuses_unified = helpers.statuses_unified()
|
statuses_unified = helpers.statuses_unified() # status "desync'ed" or not
|
||||||
if (active == 7 and statuses_unified) or (active == 9 and not statuses_unified):
|
if (active == 7 and statuses_unified) or (active == 9 and not statuses_unified):
|
||||||
# We choose change status message (7 is that, or 9 if there is the "desync'ed" option)
|
# 'Change status message' selected:
|
||||||
# do not change show, just show change status dialog
|
# do not change show, just show change status dialog
|
||||||
status = model[self.previous_status_combobox_active][2].decode('utf-8')
|
status = model[self.previous_status_combobox_active][2].decode('utf-8')
|
||||||
dlg = dialogs.ChangeStatusMessageDialog(status)
|
dlg = dialogs.ChangeStatusMessageDialog(status)
|
||||||
|
@ -3782,11 +3781,11 @@ class RosterWindow:
|
||||||
if account == '':
|
if account == '':
|
||||||
accounts = gajim.connections.keys()
|
accounts = gajim.connections.keys()
|
||||||
if music_track_info is None:
|
if music_track_info is None:
|
||||||
artist = ''
|
artist = ''
|
||||||
title = ''
|
title = ''
|
||||||
source = ''
|
source = ''
|
||||||
track = ''
|
track = ''
|
||||||
length = ''
|
length = ''
|
||||||
elif hasattr(music_track_info, 'paused') and \
|
elif hasattr(music_track_info, 'paused') and \
|
||||||
music_track_info.paused == 0:
|
music_track_info.paused == 0:
|
||||||
artist = ''
|
artist = ''
|
||||||
|
@ -3861,8 +3860,8 @@ class RosterWindow:
|
||||||
uf_show = helpers.get_uf_show(show)
|
uf_show = helpers.get_uf_show(show)
|
||||||
liststore = self.status_combobox.get_model()
|
liststore = self.status_combobox.get_model()
|
||||||
liststore.prepend(['SEPARATOR', None, '', True])
|
liststore.prepend(['SEPARATOR', None, '', True])
|
||||||
liststore.prepend([uf_show+" "+"(desync'ed)", self.jabber_state_images['16'][show],
|
liststore.prepend([uf_show+" "+"(desync'ed)",
|
||||||
show, False])
|
self.jabber_state_images['16'][show], show, False])
|
||||||
self.status_combobox.set_active(0)
|
self.status_combobox.set_active(0)
|
||||||
self._change_awn_icon_status(show)
|
self._change_awn_icon_status(show)
|
||||||
self.combobox_callback_active = True
|
self.combobox_callback_active = True
|
||||||
|
@ -5565,7 +5564,8 @@ class RosterWindow:
|
||||||
self.draw_roster()
|
self.draw_roster()
|
||||||
|
|
||||||
if gajim.config.get('use_pep'):
|
if gajim.config.get('use_pep'):
|
||||||
self.enable_syncing_status_msg_from_current_music_track(gajim.config.get('publish_tune'))
|
self.enable_syncing_status_msg_from_current_music_track(
|
||||||
|
gajim.config.get('publish_tune'))
|
||||||
else:
|
else:
|
||||||
## Music Track notifications
|
## Music Track notifications
|
||||||
## FIXME: we use a timeout because changing status of
|
## FIXME: we use a timeout because changing status of
|
||||||
|
|
Loading…
Reference in New Issue