Additional fixes and tweaks

This commit is contained in:
Raoul Snyman 2013-02-11 21:44:04 +02:00
parent 00a0748423
commit 3b3eab52c5
4 changed files with 11 additions and 8 deletions

View File

@ -27,7 +27,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # 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 import translate
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import critical_error_message_box

View File

@ -40,6 +40,7 @@ log = logging.getLogger(__name__)
VERSE_REGEX = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') VERSE_REGEX = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---')
class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
""" """
This is the form that is used to edit the verses of the song. This is the form that is used to edit the verses of the song.

View File

@ -26,6 +26,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # 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 import re
from PyQt4 import QtGui from PyQt4 import QtGui
@ -37,8 +40,7 @@ from ui import SongStrings
WHITESPACE = re.compile(r'[\W_]+', re.UNICODE) WHITESPACE = re.compile(r'[\W_]+', re.UNICODE)
APOSTROPHE = re.compile(u'[\'`ʻ]', re.UNICODE) APOSTROPHE = re.compile(u'[\'`ʻ]', re.UNICODE)
PATTERN = re.compile(r"\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'" PATTERN = re.compile(r"\\([a-z]{1,32})(-?\d{1,10})?[ ]?|\\'([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)", re.I)
r"([0-9a-f]{2})|\\([^a-z])|([{}])|[\r\n]+|(.)", re.I)
# RTF control words which specify a "destination" to be ignored. # RTF control words which specify a "destination" to be ignored.
DESTINATIONS = frozenset(( DESTINATIONS = frozenset((
u'aftncn', u'aftnsep', u'aftnsepc', u'annotation', u'atnauthor', u'aftncn', u'aftnsep', u'aftnsepc', u'annotation', u'atnauthor',
@ -622,6 +624,6 @@ def natcmp(a, b):
return result return result
return 1 return 1
from xml import OpenLyrics, SongXML from openlp.plugins.songs.lib.xml import OpenLyrics, SongXML
from songstab import SongsTab from openlp.plugins.songs.lib.songstab import SongsTab
from mediaitem import SongMediaItem from openlp.plugins.songs.lib.mediaitem import SongMediaItem

View File

@ -97,7 +97,7 @@ class TestAuthorsForm(TestCase):
display_name = u'John' display_name = u'John'
# WHEN: The display_name_edit's text is set # 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 # 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') 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 self.form.display_name = display_name
# THEN: The display_name_edit should have the correct value # 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')