From a5cd1e15bcc857098385194e106177dc962c786a Mon Sep 17 00:00:00 2001 From: Chris Hill Date: Mon, 25 Apr 2016 12:01:32 +0100 Subject: [PATCH] resolve pep8 W293 warning --- openlp/plugins/songs/forms/editsongform.py | 6 +++--- openlp/plugins/songs/forms/songexportform.py | 2 +- .../plugins/songs/forms/songmaintenanceform.py | 6 +++--- openlp/plugins/songs/lib/mediaitem.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 386380ec0..b33788a4c 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -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 diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index da49f2728..e8a559c44 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -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) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 55e5031fe..74462e6d0 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -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) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0824a80b0..8edac2877 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -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)