[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309375 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Review: Approve -- https://code.launchpad.net/~trb143/openlp/reporting/+merge/309375 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309375 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well Fixed issues and comments 1800 songs takes about 3 secs to run on my i7 lp:~trb143/openlp/reporting (revision 2701) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1801/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1712/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1650/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1406/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/996/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1064/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/932/ [SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/93/ -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-09-02 16:19:28 + +++ openlp/core/common/settings.py 2016-10-26 18:03:31 + @@ -381,6 +381,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/toolsSongListReport': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/songs/lib/openlyricsxml.py' --- openlp/plugins/songs/lib/openlyricsxml.py 2016-08-05 19:57:25 + +++ openlp/plugins/songs/lib/openlyricsxml.py 2016-10-26 18:03:31 + @@ -458,7 +458,7 @@ self._add_tag_to_formatting(tag, tags_element) # Replace end tags. for tag in end_tags: -text = text.replace('{{{tag}}}'.format(tag=tag), '') +text = text.replace('{{/{tag}}}'.format(tag=tag), '') # Replace \n with . text = text.replace('\n', '') element = etree.XML('{text}'.format(text=text)) === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-10-26 18:03:31 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-10-26 18:03:31 + @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for# +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +### +""" +The :mod:`db` module provides the ability to provide a csv file of all songs +""" +import csv +import logging + +from PyQt5 import QtWidgets + +from openlp.core.common import Registry, translate +from openlp.core.lib.ui import critical_error_mess
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309296 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Review: Needs Fixing Couple extra things: 1. The save dialog says "output folder" or something, just make it say "Save file" 2. There's no list of file extensions in the dialog, and no default file name and/or extension. -- https://code.launchpad.net/~trb143/openlp/reporting/+merge/309296 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309093 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309296 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well Fixed issues and comments 1800 songs takes about 3 secs to run on my i7 lp:~trb143/openlp/reporting (revision 2701) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1801/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1712/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1650/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1406/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/996/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1064/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/932/ [SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/93/ -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-09-02 16:19:28 + +++ openlp/core/common/settings.py 2016-10-25 20:35:57 + @@ -381,6 +381,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/toolsSongListReport': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/songs/lib/openlyricsxml.py' --- openlp/plugins/songs/lib/openlyricsxml.py 2016-08-05 19:57:25 + +++ openlp/plugins/songs/lib/openlyricsxml.py 2016-10-25 20:35:57 + @@ -458,7 +458,7 @@ self._add_tag_to_formatting(tag, tags_element) # Replace end tags. for tag in end_tags: -text = text.replace('{{{tag}}}'.format(tag=tag), '') +text = text.replace('{{/{tag}}}'.format(tag=tag), '') # Replace \n with . text = text.replace('\n', '') element = etree.XML('{text}'.format(text=text)) === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-10-25 20:35:57 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-10-25 20:35:57 + @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for# +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +### +""" +The :mod:`db` module provides the ability to provide a csv file of all songs +""" +import csv +import logging + +from PyQt5 import QtWidgets + +from openlp.core.common import Registry, translate +from openlp.core.lib.ui import critical_error_mess
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/309093 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well Fixed issues and comments 1800 songs takes about 3 secs to run on my i7 lp:~trb143/openlp/reporting (revision 2701) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1801/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1712/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1650/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1406/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/996/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1064/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/932/ [SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/93/ -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-09-02 16:19:28 + +++ openlp/core/common/settings.py 2016-10-23 19:29:26 + @@ -381,6 +381,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/toolsSongListReport': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-10-23 19:29:26 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-10-23 19:29:26 + @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for# +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +### +""" +The :mod:`db` module provides the ability to provide a csv file of all songs +""" +import csv +import logging + +from PyQt5 import QtWidgets + +from openlp.core.common import Registry, translate +from openlp.core.lib.ui import critical_error_message_box +from openlp.plugins.songs.lib.db import Song + + +log = logging.getLogger(__name__) + + +def report_song_list(): +""" +Export the song list as a CSV file. +:return: Nothing +""" +main_window = Registry().get('main_window') +plugin = Registry().get('songs').plugin +report_file_name, filter_used = QtWidgets.QFileDialog.getSaveFileName( +main_window, translate('SongPlugin.ReportSongList', 'Output File Location')) +if not report_file_name: +main_window.error_message( +translate('SongPlugin.ReportSongList', 'Output Path Not Selected'), +
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/306387 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/306387 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well Fixed issues and comments 1800 songs takes about 3 secs to run on my i7 lp:~trb143/openlp/reporting (revision 2700) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1780/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1691/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1629/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1385/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/975/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1043/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/911/ -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-07-31 11:58:54 + +++ openlp/core/common/settings.py 2016-09-21 19:11:04 + @@ -379,6 +379,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/toolsSongListReport': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/custom/lib/mediaitem.py' --- openlp/plugins/custom/lib/mediaitem.py 2016-05-21 18:19:18 + +++ openlp/plugins/custom/lib/mediaitem.py 2016-09-21 19:11:04 + @@ -350,7 +350,7 @@ :param string: The search string :param show_error: The error string to be show. """ -search = '%{search}%'.forma(search=string.lower()) +search = '%{search}%'.format(search=string.lower()) search_results = self.plugin.db_manager.get_all_objects(CustomSlide, or_(func.lower(CustomSlide.title).like(search), func.lower(CustomSlide.text).like(search)), === modified file 'openlp/plugins/songs/forms/editsongform.py' --- openlp/plugins/songs/forms/editsongform.py 2016-05-27 08:13:14 + +++ openlp/plugins/songs/forms/editsongform.py 2016-09-21 19:11:04 + @@ -317,7 +317,7 @@ self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)', r'\g<1>1\2', self.song.verse_order) except: -log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml())) +log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml())) raise def keyPressEvent(self, event): === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-09-21 19:11:04 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-09-21 19:11:04 + @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General P
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/306259 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Still missing tests for your new module. Guess its up to superfly if he's happy with that. Also, just a few inline comments Diff comments: > > === added file 'openlp/plugins/songs/reporting.py' > --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + > +++ openlp/plugins/songs/reporting.py 2016-09-20 18:07:02 + > @@ -0,0 +1,99 @@ > +# -*- coding: utf-8 -*- > +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 > softtabstop=4 > + > +### > +# OpenLP - Open Source Lyrics Projection > # > +# > --- # > +# Copyright (c) 2008-2016 OpenLP Developers > # > +# > --- # > +# This program is free software; you can redistribute it and/or modify it > # > +# under the terms of the GNU General Public License as published by the Free > # > +# Software Foundation; version 2 of the License. > # > +# > # > +# This program is distributed in the hope that it will be useful, but > WITHOUT # > +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > # > +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > # > +# more details. > # > +# > # > +# You should have received a copy of the GNU General Public License along > # > +# with this program; if not, write to the Free Software Foundation, Inc., 59 > # > +# Temple Place, Suite 330, Boston, MA 02111-1307 USA > # > +### > +""" > +The :mod:`db` module provides the ability to provide a csv file of all songs > +""" > +import csv > +import logging > + > +from PyQt5 import QtWidgets > + > +from openlp.core.common import Registry, translate > +from openlp.core.lib.ui import critical_error_message_box > +from openlp.plugins.songs.lib.db import Song > + > + > +log = logging.getLogger(__name__) > + > + > +def report_song_list(): > +""" > +Export the song list as a CSV file. > +:return: Nothing > +""" > +main_window = Registry().get('main_window') > +plugin = Registry().get('songs').plugin > +report_file_name, filter_used = QtWidgets.QFileDialog.getSaveFileName( > +main_window, translate('SongPlugin.ReportSongList', 'Output File > Location')) > +if not report_file_name: > +main_window.error_message( > +translate('SongPlugin.ReportSongList', 'Output Path Not > Selected'), > +translate('SongPlugin.ReportSongList', 'You have not set a valid > output location for your ' > + 'report. \nPlease select > an existing path ' > + 'on your computer.') > +) > +return > +if not report_file_name.endswith('csv'): > +report_file_name += '.csv' > +file_handle = None > +try: > +file_handle = open(report_file_name, 'wt') > +fieldnames = ('Title', 'Alternative Title', 'Copyright', > 'Author(s)', 'Song Book', 'Topic') > +writer = csv.DictWriter(file_handle, fieldnames=fieldnames, > quoting=csv.QUOTE_ALL) > +headers = dict((n, n) for n in fieldnames) > +writer.writerow(headers) > +song_list = plugin.manager.get_all_objects(Song) > +for song in song_list: > +author_list = [] > +for author_song in song.authors_songs: > +author_list.append(author_song.author.display_name) > +author_string = '{name}'.format(name=' | '.join(author_list)) couldn't this just be: author_string = ' | '.join(author_list) > +book_list = [] > +for book_song in song.songbook_entries: > +if hasattr(book_song, 'entry') and book_song.entry: > +book_list.append('{name} > #{entry}'.format(name=book_song.songbook.name, entry=book_song.entry)) > +book_string = '{name}'.format(name=' | '.join(book_list)) and: book_string = ' | '.join(book_list) > +topic_list = [] > +for topic_song in song.topics: > +if hasattr(topic_song, 'name'): > +topic_list.append(topic_song.name) > +topic_string = '{name}'.format(name=' | '.join(topic_list)) and: topic_string = ' | '.join(topic_list) > +writer.writerow({'Title': song.title, > + 'Alternative Title': song.alternate_title, > + 'Copyright': song.copyright, >
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/306259 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well Fixed issues and comments 1800 songs takes about 3 secs to run on my i7 lp:~trb143/openlp/reporting (revision 2699) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1779/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1690/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1628/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1384/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/974/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1042/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/910/ [SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/73/ -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-07-31 11:58:54 + +++ openlp/core/common/settings.py 2016-09-20 18:07:02 + @@ -379,6 +379,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/toolsSongListReport': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/custom/lib/mediaitem.py' --- openlp/plugins/custom/lib/mediaitem.py 2016-05-21 18:19:18 + +++ openlp/plugins/custom/lib/mediaitem.py 2016-09-20 18:07:02 + @@ -350,7 +350,7 @@ :param string: The search string :param show_error: The error string to be show. """ -search = '%{search}%'.forma(search=string.lower()) +search = '%{search}%'.format(search=string.lower()) search_results = self.plugin.db_manager.get_all_objects(CustomSlide, or_(func.lower(CustomSlide.title).like(search), func.lower(CustomSlide.text).like(search)), === modified file 'openlp/plugins/songs/forms/editsongform.py' --- openlp/plugins/songs/forms/editsongform.py 2016-05-27 08:13:14 + +++ openlp/plugins/songs/forms/editsongform.py 2016-09-20 18:07:02 + @@ -317,7 +317,7 @@ self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)', r'\g<1>1\2', self.song.verse_order) except: -log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml())) +log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml())) raise def keyPressEvent(self, event): === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-09-20 18:07:02 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-09-20 18:07:02 + @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/305167 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
See my inline comments about your test doc stings and comments. And also see my inline comments with regard to the Unicode literals. They're not required, and seem only to be implemented to ease porting from py2! https://www.python.org/dev/peps/pep-0414/#proposal Are there any tests for the new module/method you've addded: reporting.py on_tools_report_song_list_triggered Diff comments: > > === modified file 'tests/functional/openlp_core_ui/test_servicemanager.py' > --- tests/functional/openlp_core_ui/test_servicemanager.py2016-07-17 > 19:46:06 + > +++ tests/functional/openlp_core_ui/test_servicemanager.py2016-09-08 > 05:12:22 + > @@ -679,3 +680,72 @@ > # THEN: The "save_as" method is called to save the service > self.assertTrue(result) > mocked_save_file_as.assert_called_with() > + > + > @patch(u'openlp.core.ui.servicemanager.ServiceManager.regenerate_service_items') Do you really need the u' here? Isn't u' and ' the same? > +def test_theme_change_global(self, mocked_regenerate_service_items): > +""" > +Test that when a Toolbar theme combobox displays correctly Test what? > +""" > + > +# GIVEN: A service manager, a service to save with a theme level of > the renderer > +mocked_renderer = MagicMock() > +service_manager = ServiceManager(None) > +Registry().register('renderer', mocked_renderer) > +service_manager.toolbar = OpenLPToolbar(None) > +service_manager.toolbar.add_toolbar_action('theme_combo_box', > triggers=MagicMock()) > +service_manager.toolbar.add_toolbar_action('theme_label', > triggers=MagicMock()) > + > +# WHEN: The service manager has a Global theme > +mocked_renderer.theme_level = ThemeLevel.Global > +result = service_manager.theme_change() > + > +# THEN: The the theme toolbar should not be visible > + > + > self.assertFalse(service_manager.toolbar.actions['theme_combo_box'].isVisible(), > + 'The visibility should be False') > + > + > @patch(u'openlp.core.ui.servicemanager.ServiceManager.regenerate_service_items') And u' here? > +def test_theme_change_service(self, mocked_regenerate_service_items): > +""" > +Test that when a Toolbar theme combobox displays correctly Again test what? > +""" > + > +# GIVEN: A service manager, a service to save with a theme level of > the renderer > +mocked_renderer = MagicMock() > +service_manager = ServiceManager(None) > +Registry().register('renderer', mocked_renderer) > +service_manager.toolbar = OpenLPToolbar(None) > +service_manager.toolbar.add_toolbar_action('theme_combo_box', > triggers=MagicMock()) > +service_manager.toolbar.add_toolbar_action('theme_label', > triggers=MagicMock()) > + > +# WHEN: The service manager has a Global theme Service level theme > +mocked_renderer.theme_level = ThemeLevel.Service > +result = service_manager.theme_change() > + > +# THEN: The the theme toolbar should not be visible Should be visible > + > + > self.assertTrue(service_manager.toolbar.actions['theme_combo_box'].isVisible(), > +'The visibility should be True') > + > + > @patch(u'openlp.core.ui.servicemanager.ServiceManager.regenerate_service_items') > +def test_theme_change_song(self, mocked_regenerate_service_items): > +""" And u' again? > +Test that when a Toolbar theme combobox displays correctly Again test what? > +""" > + > +# GIVEN: A service manager, a service to save with a theme level of > the renderer > +mocked_renderer = MagicMock() > +service_manager = ServiceManager(None) > +Registry().register('renderer', mocked_renderer) > +service_manager.toolbar = OpenLPToolbar(None) > +service_manager.toolbar.add_toolbar_action('theme_combo_box', > triggers=MagicMock()) > +service_manager.toolbar.add_toolbar_action('theme_label', > triggers=MagicMock()) > + > +# WHEN: The service manager has a Global theme Should be song level theme > +mocked_renderer.theme_level = ThemeLevel.Song > +result = service_manager.theme_change() > + > +# THEN: The the theme toolbar should not be visible Should be visible > + > + > self.assertTrue(service_manager.toolbar.actions['theme_combo_box'].isVisible(), > +'The visibility should be True') -- https://code.launchpad.net/~trb143/openlp/reporting/+merge/305167 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Review: Needs Fixing 1. There's a "csv" module, use it. 2. I should be able to specify the file name, not just where to save it to. 3. Have you tested this with > 1000 songs? How long does it take? Some sort of progress window necessary? 4. You call it a report internally, but you're not very specific for the user. Rather call it a "Song List Report". More comments inline. Diff comments: > === modified file 'openlp/core/common/settings.py' > --- openlp/core/common/settings.py2016-07-31 11:58:54 + > +++ openlp/core/common/settings.py2016-09-08 05:12:22 + > @@ -379,6 +379,7 @@ > 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], > 'shortcuts/toolsReindexItem': [], > 'shortcuts/toolsFindDuplicates': [], > +'shortcuts/ReportSongList': [], Surely this should have the same naming convention as the other items? > 'shortcuts/toolsAlertItem': > [QtGui.QKeySequence(QtCore.Qt.Key_F7)], > 'shortcuts/toolsFirstTimeWizard': [], > 'shortcuts/toolsOpenDataFolder': [], > > === modified file 'openlp/plugins/songs/songsplugin.py' > --- openlp/plugins/songs/songsplugin.py 2016-03-31 16:34:22 + > +++ openlp/plugins/songs/songsplugin.py 2016-09-08 05:12:22 + > @@ -151,19 +152,37 @@ > :param tools_menu: The actual **Tools** menu item, so that your > actions can use it as their parent. > """ > log.info('add tools menu') > +self.tools_menu = tools_menu > +self.song_tools_menu = QtWidgets.QMenu(tools_menu) > +self.song_tools_menu.setObjectName('song_tools_menu') > +self.song_tools_menu.setTitle(translate('SongsPlugin', 'Song Tools')) The item is in the "Tools" menu, you don't need to say "Song Tools", just say "Songs" > self.tools_reindex_item = create_action( > tools_menu, 'toolsReindexItem', > text=translate('SongsPlugin', '&Re-index Songs'), > icon=':/plugins/plugin_songs.png', > statustip=translate('SongsPlugin', 'Re-index the songs database > to improve searching and ordering.'), > -visible=False, triggers=self.on_tools_reindex_item_triggered) > -tools_menu.addAction(self.tools_reindex_item) > +triggers=self.on_tools_reindex_item_triggered) > self.tools_find_duplicates = create_action( > tools_menu, 'toolsFindDuplicates', > text=translate('SongsPlugin', 'Find &Duplicate Songs'), > statustip=translate('SongsPlugin', 'Find and remove duplicate > songs in the song database.'), > -visible=False, triggers=self.on_tools_find_duplicates_triggered, > can_shortcuts=True) > -tools_menu.addAction(self.tools_find_duplicates) > +triggers=self.on_tools_find_duplicates_triggered, > can_shortcuts=True) > +self.tools_report_song_list = create_action( > +tools_menu, 'ReportSongList', > +text=translate('SongsPlugin', 'Export List of Songs'), You call it a report internally, but you're not very specific for the user. Rather call it a "Song List Report". > +statustip=translate('SongsPlugin', 'Produce a CSV file of all > the songs in the database.'), > +triggers=self.on_tools_report_song_list_triggered) > + > +self.tools_menu.addAction(self.song_tools_menu.menuAction()) > +self.song_tools_menu.addAction(self.tools_reindex_item) > +self.song_tools_menu.addAction(self.tools_find_duplicates) > +self.song_tools_menu.addAction(self.tools_report_song_list) > + > +self.song_tools_menu.menuAction().setVisible(False) > + > +@staticmethod > +def on_tools_report_song_list_triggered(): > +reporting.report_song_list() > > def on_tools_reindex_item_triggered(self): > """ -- https://code.launchpad.net/~trb143/openlp/reporting/+merge/305167 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: OpenLP Core (openlp-core) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/305167 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Fixed some errors spotted as well lp:~trb143/openlp/reporting (revision 2698) [SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1766/ [SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1677/ [SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1615/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1371/ [SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/961/ [SUCCESS] https://ci.openlp.io/job/Branch-05a-Code_Analysis/1029/ [SUCCESS] https://ci.openlp.io/job/Branch-05b-Test_Coverage/897/ [SUCCESS] https://ci.openlp.io/job/Branch-05c-Code_Analysis2/61/ -- Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/reporting into lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-07-31 11:58:54 + +++ openlp/core/common/settings.py 2016-09-08 05:12:22 + @@ -379,6 +379,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/ReportSongList': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/custom/lib/mediaitem.py' --- openlp/plugins/custom/lib/mediaitem.py 2016-05-21 18:19:18 + +++ openlp/plugins/custom/lib/mediaitem.py 2016-09-08 05:12:22 + @@ -350,7 +350,7 @@ :param string: The search string :param show_error: The error string to be show. """ -search = '%{search}%'.forma(search=string.lower()) +search = '%{search}%'.format(search=string.lower()) search_results = self.plugin.db_manager.get_all_objects(CustomSlide, or_(func.lower(CustomSlide.title).like(search), func.lower(CustomSlide.text).like(search)), === modified file 'openlp/plugins/songs/forms/editsongform.py' --- openlp/plugins/songs/forms/editsongform.py 2016-05-27 08:13:14 + +++ openlp/plugins/songs/forms/editsongform.py 2016-09-08 05:12:22 + @@ -317,7 +317,7 @@ self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)', r'\g<1>1\2', self.song.verse_order) except: -log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml())) +log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml())) raise def keyPressEvent(self, event): === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-09-08 05:12:22 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-09-08 05:12:22 + @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
The proposal to merge lp:~trb143/openlp/reporting into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/304841 -- Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/reporting into lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~trb143/openlp/reporting into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/reporting into lp:openlp. Requested reviews: OpenLP Core (openlp-core) For more details, see: https://code.launchpad.net/~trb143/openlp/reporting/+merge/304841 My dad needed a report of all the songs on their database, they had 1800. Made this into a reporting option and cleaned up the menu. Needs tests I know but this is a look at the report and fields included. Fixed some typos found as well. -- Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/reporting into lp:openlp. === modified file 'openlp/core/common/settings.py' --- openlp/core/common/settings.py 2016-07-31 11:58:54 + +++ openlp/core/common/settings.py 2016-09-03 07:22:50 + @@ -379,6 +379,7 @@ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)], 'shortcuts/toolsReindexItem': [], 'shortcuts/toolsFindDuplicates': [], +'shortcuts/ReportSongList': [], 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)], 'shortcuts/toolsFirstTimeWizard': [], 'shortcuts/toolsOpenDataFolder': [], === modified file 'openlp/plugins/custom/lib/mediaitem.py' --- openlp/plugins/custom/lib/mediaitem.py 2016-05-21 18:19:18 + +++ openlp/plugins/custom/lib/mediaitem.py 2016-09-03 07:22:50 + @@ -350,7 +350,7 @@ :param string: The search string :param show_error: The error string to be show. """ -search = '%{search}%'.forma(search=string.lower()) +search = '%{search}%'.format(search=string.lower()) search_results = self.plugin.db_manager.get_all_objects(CustomSlide, or_(func.lower(CustomSlide.title).like(search), func.lower(CustomSlide.text).like(search)), === modified file 'openlp/plugins/songs/forms/editsongform.py' --- openlp/plugins/songs/forms/editsongform.py 2016-05-27 08:13:14 + +++ openlp/plugins/songs/forms/editsongform.py 2016-09-03 07:22:50 + @@ -317,7 +317,7 @@ self.song.verse_order = re.sub('([' + verse.upper() + verse.lower() + '])(\W|$)', r'\g<1>1\2', self.song.verse_order) except: -log.exception('Problem processing song Lyrics \n{xml}'.forma(xml=sxml.dump_xml())) +log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml())) raise def keyPressEvent(self, event): === modified file 'openlp/plugins/songs/lib/songcompare.py' --- openlp/plugins/songs/lib/songcompare.py 2015-12-31 22:46:06 + +++ openlp/plugins/songs/lib/songcompare.py 2016-09-03 07:22:50 + @@ -46,13 +46,13 @@ MAX_TYPO_SIZE = 3 -def songs_probably_equal(song_tupel): +def songs_probably_equal(song_tuple): """ Calculate and return whether two songs are probably equal. -:param song_tupel: A tuple of two songs to compare. +:param song_tuple: A tuple of two songs to compare. """ -song1, song2 = song_tupel +song1, song2 = song_tuple pos1, lyrics1 = song1 pos2, lyrics2 = song2 if len(lyrics1) < len(lyrics2): === added file 'openlp/plugins/songs/reporting.py' --- openlp/plugins/songs/reporting.py 1970-01-01 00:00:00 + +++ openlp/plugins/songs/reporting.py 2016-09-03 07:22:50 + @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +### +# OpenLP - Open Source Lyrics Projection # +# --- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for# +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +###