From 3b3eab52c558f92123c4f12f1997b7ab9cfad90c Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Mon, 11 Feb 2013 21:44:04 +0200 Subject: [PATCH] Additional fixes and tweaks --- openlp/plugins/songs/forms/authorsform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 1 + openlp/plugins/songs/lib/__init__.py | 12 +++++++----- .../openlp_plugins_songs_forms/test_authorsform.py | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 4c1e8e2e6..2d94ad3da 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -27,7 +27,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtGui, QtCore +from PyQt4 import QtGui from openlp.core.lib import translate from openlp.core.lib.ui import critical_error_message_box diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 6e5c0127e..f66cd6db1 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -40,6 +40,7 @@ log = logging.getLogger(__name__) VERSE_REGEX = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') + class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ This is the form that is used to edit the verses of the song. diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index c7c24533b..fdcaf47bb 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -26,6 +26,9 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +""" +The :mod:`~openlp.plugins.songs.lib` module contains a number of library functions and classes used in the Songs plugin. +""" import re from PyQt4 import QtGui @@ -37,8 +40,7 @@ from ui import SongStrings WHITESPACE = re.compile(r'[\W_]+', re.UNICODE) APOSTROPHE = re.compile(u'[\'`’ʻ′]', re.UNICODE) -PATTERN = re.compile(r"\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'" - r"([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)", re.I) +PATTERN = re.compile(r"\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)", re.I) # RTF control words which specify a "destination" to be ignored. DESTINATIONS = frozenset(( u'aftncn', u'aftnsep', u'aftnsepc', u'annotation', u'atnauthor', @@ -622,6 +624,6 @@ def natcmp(a, b): return result return 1 -from xml import OpenLyrics, SongXML -from songstab import SongsTab -from mediaitem import SongMediaItem +from openlp.plugins.songs.lib.xml import OpenLyrics, SongXML +from openlp.plugins.songs.lib.songstab import SongsTab +from openlp.plugins.songs.lib.mediaitem import SongMediaItem diff --git a/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py b/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py index dc578496d..0a8775a7b 100644 --- a/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py +++ b/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py @@ -97,7 +97,7 @@ class TestAuthorsForm(TestCase): display_name = u'John' # WHEN: The display_name_edit's text is set - self.form.display_name_edit.setText(display_name) + self.form.display_edit.setText(display_name) # THEN: The display_name property should have the correct value self.assertEqual(self.form.display_name, display_name, u'The display name property should be correct') @@ -113,5 +113,5 @@ class TestAuthorsForm(TestCase): self.form.display_name = display_name # THEN: The display_name_edit should have the correct value - self.assertEqual(self.form.display_name_edit.text(), display_name, u'The display name should be set correctly') + self.assertEqual(self.form.display_edit.text(), display_name, u'The display name should be set correctly')