openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #25715
[Merge] lp:~phill-ridout/openlp/bug1412234 into lp:openlp
Phill has proposed merging lp:~phill-ridout/openlp/bug1412234 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1412234 in OpenLP: "bibles __init__.py has interesting translation string"
https://bugs.launchpad.net/openlp/+bug/1412234
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug1412234/+merge/247072
Brakes up the translation string to just the string elements
Add this to your merge proposal:
--------------------------------
lp:~phill-ridout/openlp/bug1412234 (revision 2481)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/886/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/818/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/764/
[SUCCESS] http://ci.openlp.org/job/Branch-04a-Windows_Functional_Tests/675/
[SUCCESS] http://ci.openlp.org/job/Branch-04b-Windows_Interface_Tests/274/
[SUCCESS] http://ci.openlp.org/job/Branch-05a-Code_Analysis/423/
[SUCCESS] http://ci.openlp.org/job/Branch-05b-Test_Coverage/294/
--
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/bug1412234 into lp:openlp.
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py 2015-01-19 08:34:29 +0000
+++ openlp/core/ui/firsttimeform.py 2015-01-20 21:51:03 +0000
@@ -182,7 +182,7 @@
title = translate('OpenLP.FirstTimeWizard', 'Network Error')
msg.setText('{} {}'.format(title, err.code if hasattr(err, 'code') else ''))
msg.setInformativeText(translate('OpenLP.FirstTimeWizard',
- 'There was a network error attempting to'
+ 'There was a network error attempting to '
'connect to retrieve initial configuration information'))
msg.setStandardButtons(msg.Ok)
ans = msg.exec_()
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2015-01-18 13:39:21 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2015-01-20 21:51:03 +0000
@@ -602,7 +602,7 @@
if bible_type == BibleFormat.WebDownload:
self.progress_label.setText(
translate('BiblesPlugin.ImportWizardForm', 'Registered Bible. Please note, that verses will be '
- 'downloaded on\ndemand and thus an internet connection is required.'))
+ 'downloaded on demand and thus an internet connection is required.'))
else:
self.progress_label.setText(WizardStrings.FinishedImport)
else:
=== modified file 'openlp/plugins/bibles/lib/__init__.py'
--- openlp/plugins/bibles/lib/__init__.py 2015-01-18 13:39:21 +0000
+++ openlp/plugins/bibles/lib/__init__.py 2015-01-20 21:51:03 +0000
@@ -175,10 +175,32 @@
"""
Updates separators and matches for parsing and formating scripture references.
"""
- default_separators = \
- translate('BiblesPlugin',
- ':|v|V|verse|verses;;-|to;;,|and;;end Double-semicolon delimited separators for parsing references. '
- 'Consult the developers for further information.').split(';;')
+ default_separators = ['|'.join([translate('BiblesPlugin', ':',
+ 'Verse identifier e.g. Genisis 1 : 1 = Genisis Chapter 1 Verse 1'),
+ translate('BiblesPlugin', 'v',
+ 'Verse identifier e.g. Genisis 1 v 1 = Genisis Chapter 1 Verse 1'),
+ translate('BiblesPlugin', 'V',
+ 'Verse identifier e.g. Genisis 1 V 1 = Genisis Chapter 1 Verse 1'),
+ translate('BiblesPlugin', 'verse',
+ 'Verse identifier e.g. Genisis 1 verse 1 = Genisis Chapter 1 Verse 1'),
+ translate('BiblesPlugin', 'verses',
+ 'Verse identifier e.g. Genisis 1 verses 1 - 2 = '
+ 'Genisis Chapter 1 Verses 1 to 2')]),
+ '|'.join([translate('BiblesPlugin', '-',
+ 'range identifier e.g. Genisis 1 verse 1 - 2 = '
+ 'Genisis Chapter 1 Verses 1 To 2'),
+ translate('BiblesPlugin', 'to',
+ 'range identifier e.g. Genisis 1 verse 1 - 2 = '
+ 'Genisis Chapter 1 Verses 1 To 2')]),
+ '|'.join([translate('BiblesPlugin', ',',
+ 'connecting identifier e.g. Genisis 1 verse 1 - 2, 4 - 5 = '
+ 'Genisis Chapter 1 Verses 1 To 2 And Verses 4 To 5'),
+ translate('BiblesPlugin', 'and',
+ 'connecting identifier e.g. Genisis 1 verse 1 - 2 and 4 - 5 = '
+ 'Genisis Chapter 1 Verses 1 To 2 And Verses 4 To 5')]),
+ '|'.join([translate('BiblesPlugin', 'end',
+ 'ending identifier e.g. Genisis 1 verse 1 - end = '
+ 'Genisis Chapter 1 Verses 1 To The Last Verse')])]
settings = Settings()
settings.beginGroup('bibles')
custom_separators = [
=== modified file 'tests/functional/openlp_plugins/bibles/test_lib.py'
--- tests/functional/openlp_plugins/bibles/test_lib.py 2015-01-18 13:39:21 +0000
+++ tests/functional/openlp_plugins/bibles/test_lib.py 2015-01-20 21:51:03 +0000
@@ -24,13 +24,38 @@
"""
from unittest import TestCase
+from openlp.plugins.bibles import lib
from openlp.plugins.bibles.lib import SearchResults
+from tests.functional import MagicMock, patch
class TestLib(TestCase):
"""
Test the functions in the :mod:`lib` module.
"""
+ def get_reference_separator_test(self):
+ """
+ Test the get_reference_separator method
+ """
+ # GIVEN: A list of expected separators
+ separators = {'sep_r': '\\s*(?:e)\\s*', 'sep_e_default': 'end', 'sep_v_display': 'w', 'sep_l_display': 'r',
+ 'sep_v_default': ':|v|V|verse|verses', 'sep_l': '\\s*(?:r)\\s*', 'sep_l_default': ',|and',
+ 'sep_e': '\\s*(?:t)\\s*', 'sep_v': '\\s*(?:w)\\s*', 'sep_r_display': 'e', 'sep_r_default': '-|to'}
+
+ def side_effect():
+ lib.REFERENCE_SEPARATORS = separators
+
+ with patch('openlp.plugins.bibles.lib.update_reference_separators',
+ **{'side_effect': side_effect}) as mocked_update_reference_separators:
+
+ # WHEN: Calling get_reference_separator
+ for key, value in separators.items():
+ ret = lib.get_reference_separator(key)
+
+ # THEN: get_reference_separator should return the correct separator
+ self.assertEqual(separators[key], value)
+ mocked_update_reference_separators.assert_called_once_with()
+
def search_results_creation_test(self):
"""
Test the creation and construction of the SearchResults class
Follow ups