resolve pep8 W293 warning

This commit is contained in:
Chris Hill 2016-04-25 12:01:32 +01:00
parent bb15b4ce71
commit a5cd1e15bc
4 changed files with 15 additions and 15 deletions

View File

@ -114,7 +114,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
def get_key(obj):
"""Get the key to sort by"""
return get_natural_key(obj.name)
objects = self.manager.get_all_objects(cls)
objects.sort(key=get_key)
combo.clear()
@ -352,7 +352,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
def get_author_key(author):
"""Get the key to sort by"""
return get_natural_key(author.display_name)
authors = self.manager.get_all_objects(Author)
authors.sort(key=get_author_key)
self.authors_combo_box.clear()
@ -392,7 +392,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
def get_theme_key(theme):
"""Get the key to sort by"""
return get_natural_key(theme)
self.theme_combo_box.clear()
self.theme_combo_box.addItem('')
self.themes = theme_list

View File

@ -206,7 +206,7 @@ class SongExportForm(OpenLPWizard):
def get_song_key(song):
"""Get the key to sort by"""
return song.sort_key
self.restart()
self.finish_button.setVisible(False)
self.cancel_button.setVisible(True)

View File

@ -124,7 +124,7 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP
def get_author_key(author):
"""Get the key to sort by"""
return get_natural_key(author.display_name)
self.authors_list_widget.clear()
authors = self.manager.get_all_objects(Author)
authors.sort(key=get_author_key)
@ -143,7 +143,7 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP
def get_topic_key(topic):
"""Get the key to sort by"""
return get_natural_key(topic.name)
self.topics_list_widget.clear()
topics = self.manager.get_all_objects(Topic)
topics.sort(key=get_topic_key)
@ -159,7 +159,7 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP
def get_book_key(book):
"""Get the key to sort by"""
return get_natural_key(book.name)
self.song_books_list_widget.clear()
books = self.manager.get_all_objects(Book)
books.sort(key=get_book_key)

View File

@ -261,7 +261,7 @@ class SongMediaItem(MediaManagerItem):
def get_song_key(song):
"""Get the key to sort by"""
return song.sort_key
log.debug('display results Song')
self.save_auto_select_id()
self.list_view.clear()
@ -290,11 +290,11 @@ class SongMediaItem(MediaManagerItem):
def get_author_key(author):
"""Get the key to sort by"""
return get_natural_key(author.display_name)
def get_song_key(song):
"""Get the key to sort by"""
return song.sort_key
log.debug('display results Author')
self.list_view.clear()
search_results.sort(key=get_author_key)
@ -319,7 +319,7 @@ class SongMediaItem(MediaManagerItem):
def get_songbook_key(songbook_entry):
"""Get the key to sort by"""
return (get_natural_key(songbook_entry.songbook.name), get_natural_key(songbook_entry.entry))
log.debug('display results Book')
self.list_view.clear()
search_results.sort(key=get_songbook_key)
@ -342,11 +342,11 @@ class SongMediaItem(MediaManagerItem):
def get_topic_key(topic):
"""Get the key to sort by"""
return get_natural_key(topic.name)
def get_song_key(song):
"""Get the key to sort by"""
return song.sort_key
log.debug('display results Topic')
self.list_view.clear()
search_results.sort(key=get_topic_key)
@ -371,7 +371,7 @@ class SongMediaItem(MediaManagerItem):
def get_theme_key(song):
"""Get the key to sort by"""
return (get_natural_key(song.theme_name), song.sort_key)
log.debug('display results Themes')
self.list_view.clear()
search_results.sort(key=get_theme_key)
@ -394,7 +394,7 @@ class SongMediaItem(MediaManagerItem):
def get_cclinumber_key(song):
"""Get the key to sort by"""
return (get_natural_key(song.ccli_number), song.sort_key)
log.debug('display results CCLI number')
self.list_view.clear()
search_results.sort(key=get_cclinumber_key)