Merge lp:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4

Proposed by Simon Hanna
Status: Superseded
Proposed branch: lp:~thelinuxguy/openlp/backport-fix
Merge into: lp:openlp/2.4
Diff against target: 76 lines (+32/-3)
4 files modified
openlp/plugins/songs/lib/importers/songbeamer.py (+2/-3)
tests/functional/openlp_plugins/songs/test_songbeamerimport.py (+7/-0)
tests/resources/songbeamersongs/cp1252song.json (+8/-0)
tests/resources/songbeamersongs/cp1252song.sng (+15/-0)
To merge this branch: bzr merge lp:~thelinuxguy/openlp/backport-fix
Reviewer Review Type Date Requested Status
Tim Bentley Needs Fixing
Review via email: mp+321284@code.launchpad.net

This proposal has been superseded by a proposal from 2017-03-29.

Description of the change

Backport songbeamer fix

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :
Download full text (5.0 KiB)

Add this to your merge proposal:
--------------------------------
lp:~thelinuxguy/openlp/backport-fix (revision 2681)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1951/
[FAILURE] https://ci.openlp.io/job/Branch-02-Functional-Tests/1862/
Stopping after failure

Test that when the logout method is called, it logs the user out of SongSelect ... ok
Test that when the logout method is called, it logs the user out of SongSelect ... ok
Test that saving a song with an existing author performs the correct actions ... ok
Test that saving a song with a new author performs the correct actions ... ok
Test that saving a song with topics performs the correct actions ... ok
Test that saving a song with an author name of only one word performs the correct actions ... ok
Test that when the search finds MAX (2) results, it simply returns a list with those (2) ... ok
Test that when the search finds no results, it simply returns an empty list ... ok
Test that when the search finds no results, it simply returns an empty list ... ok
Test that when the search finds 2 results, it simply returns a list with 2 results ... ok
Test that the search is stopped with stop() is called ... ok
Test that loading a SongShow Plus file works correctly on various files ... ok
Test creating an instance of the SongShow Plus file importer ... ok
Test SongShowPlusImport.do_import handles different invalid import_source values ... ok
Test to_openlp_verse_tag method by simulating adding a verse ... ok
Test to_openlp_verse_tag method by simulating adding a verse to the verse order ... ok
Test SongShowPlusImport.do_import handles different invalid import_source values ... ok
Test that loading an SundayPlus file works correctly on various files ... ok
Test that loading an VideoPsalm file works correctly on various files ... ok
Test that loading a Words of Worship file works correctly ... ok
Test that loading an Worship Assistant file works correctly ... ok
Failure: SkipTest (Not Windows, skipping test) ... SKIP: Not Windows, skipping test
Test that loading an ZionWorx file works correctly on various files ... ok
Test creating an instance of the ZionWorx file importer ... ok
Test the about text of the song usage plugin ... ok
Test that check_pre_condition returns true for valid manager session ... ok
Test the initialisation of the SongUsagePlugin class ... ok
Test that all the default settings are correct ... ok
Test that clicking on the dock icon on Mac OS X restores the main window if it is minimized ... ok
Test that we don't try to backup on a new install ... ok
Test that we try to backup on a new install ... ok
Test the reimplemented event method ... ok

======================================================================
ERROR: Test that a CP1252 encoded file get's decoded properly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/shared-repo/branch/tests/functional/openlp_plugins/songs/test_songbeamerimport.py", line 57, in test_cp1252_encoded_file
    self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json')))
  File "/var/lib/jenkins/shared-repo/branch/tests/helpers/songfileimport....

Read more...

review: Needs Fixing
lp:~thelinuxguy/openlp/backport-fix updated
2682. By Simon Hanna

Restore previously deleted import

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/lib/importers/songbeamer.py'
2--- openlp/plugins/songs/lib/importers/songbeamer.py 2017-01-22 17:04:32 +0000
3+++ openlp/plugins/songs/lib/importers/songbeamer.py 2017-03-29 22:05:27 +0000
4@@ -22,11 +22,10 @@
5 """
6 The :mod:`songbeamer` module provides the functionality for importing SongBeamer songs into the OpenLP database.
7 """
8-import chardet
9-import codecs
10 import logging
11 import os
12 import re
13+import chardet
14
15 from openlp.plugins.songs.lib import VerseType
16 from openlp.plugins.songs.lib.importers.songimport import SongImport
17@@ -120,7 +119,7 @@
18 # The encoding should only be ANSI (cp1252), UTF-8, Unicode, Big-Endian-Unicode.
19 # So if it doesn't start with 'u' we default to cp1252. See:
20 # https://forum.songbeamer.com/viewtopic.php?p=419&sid=ca4814924e37c11e4438b7272a98b6f2
21- if self.input_file_encoding.lower().startswith('u'):
22+ if not self.input_file_encoding.lower().startswith('u'):
23 self.input_file_encoding = 'cp1252'
24 infile = open(import_file, 'rt', encoding=self.input_file_encoding)
25 song_data = infile.readlines()
26
27=== modified file 'tests/functional/openlp_plugins/songs/test_songbeamerimport.py'
28--- tests/functional/openlp_plugins/songs/test_songbeamerimport.py 2016-12-31 11:05:48 +0000
29+++ tests/functional/openlp_plugins/songs/test_songbeamerimport.py 2017-03-29 22:05:27 +0000
30@@ -49,6 +49,13 @@
31 self.file_import([os.path.join(TEST_PATH, 'Lobsinget dem Herrn.sng')],
32 self.load_external_result_data(os.path.join(TEST_PATH, 'Lobsinget dem Herrn.json')))
33
34+ def test_cp1252_encoded_file(self):
35+ """
36+ Test that a CP1252 encoded file get's decoded properly.
37+ """
38+ self.file_import([os.path.join(TEST_PATH, 'cp1252song.sng')],
39+ self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json')))
40+
41
42 class TestSongBeamerImport(TestCase):
43 """
44
45=== added file 'tests/resources/songbeamersongs/cp1252song.json'
46--- tests/resources/songbeamersongs/cp1252song.json 1970-01-01 00:00:00 +0000
47+++ tests/resources/songbeamersongs/cp1252song.json 2017-03-29 22:05:27 +0000
48@@ -0,0 +1,8 @@
49+{
50+"title": "Some Song",
51+ "authors": ["Author"],
52+ "verses" : [
53+ ["Here are a couple of \"weird\" chars’’’.\n", "v"],
54+ ["Here is another one….\n\n", "v"]
55+ ]
56+}
57
58=== added file 'tests/resources/songbeamersongs/cp1252song.sng'
59--- tests/resources/songbeamersongs/cp1252song.sng 1970-01-01 00:00:00 +0000
60+++ tests/resources/songbeamersongs/cp1252song.sng 2017-03-29 22:05:27 +0000
61@@ -0,0 +1,15 @@
62+#LangCount=1
63+#Editor=SongBeamer 4.28a
64+#Version=3
65+#Format=F/K//
66+#TitleFormat=U
67+#Title=Some Song
68+#Author=Author
69+#Melody=Author
70+#(c)=No copyright
71+#CCLI=0000000000
72+---
73+Here are a couple of "weird" chars’’’.
74+---
75+Here is another one….
76+

Subscribers

People subscribed via source and target branches

to all changes: