diff --git a/openlp/plugins/songs/lib/powerpraiseimport.py b/openlp/plugins/songs/lib/powerpraiseimport.py index 56ebff542..27b9c5c17 100644 --- a/openlp/plugins/songs/lib/powerpraiseimport.py +++ b/openlp/plugins/songs/lib/powerpraiseimport.py @@ -57,14 +57,25 @@ class PowerpraiseImport(SongImport): def process_song(self, root): self.set_defaults() self.title = root.general.title - count = 0; + verse_order_list = [] + for item in root.order.item: + verse_order_list.append(str(item)) + + count = 0 for part in root.songtext.part: - verse_text = "" count += 1 + verse_def = "v%d" % count + original_verse_def = part.get('caption') + verse_text = "" for slide in part.slide: for line in slide.line: verse_text += line - print(verse_text) - self.add_verse(verse_text, "v%d" % count) + self.add_verse(verse_text, verse_def) + # Update verse name in verse order list + for i in range(len(verse_order_list)): + if verse_order_list[i].lower() == original_verse_def.lower(): + verse_order_list[i] = verse_def + + self.verse_order_list = verse_order_list if not self.finish(): self.log_error(self.import_source) diff --git a/tests/helpers/songfileimport.py b/tests/helpers/songfileimport.py index afa3e48bd..613bb5c96 100644 --- a/tests/helpers/songfileimport.py +++ b/tests/helpers/songfileimport.py @@ -134,7 +134,6 @@ class SongImportTestHelper(TestCase): self.assertEqual(importer.ccli_number, ccli_number, 'ccli_number for %s should be %s' % (source_file_name, ccli_number)) expected_calls = [] - print(self.mocked_add_verse.mock_calls) for verse_text, verse_tag in add_verse_calls: self.mocked_add_verse.assert_any_call(verse_text, verse_tag) expected_calls.append(call(verse_text, verse_tag)) diff --git a/tests/resources/powerpraisesongs/Näher, mein Gott zu Dir.json b/tests/resources/powerpraisesongs/Näher, mein Gott zu Dir.json index 54094f748..b3200ba00 100644 --- a/tests/resources/powerpraisesongs/Näher, mein Gott zu Dir.json +++ b/tests/resources/powerpraisesongs/Näher, mein Gott zu Dir.json @@ -1,6 +1,6 @@ { "title": "Näher, mein Gott, zu Dir", - "verse_order_list": [], + "verse_order_list": ["v1", "v2", "v3"], "verses": [ [ "Näher, mein Gott, zu Dir,sei meine Bitt'!Näher, o Herr, zu Dirmit jedem Schritt.Nur an dem Herzen Deinkann ich geborgen sein;deshalb die Bitte mein:Näher zu Dir!",