forked from openlp/openlp
Fixes
This commit is contained in:
parent
7112356c21
commit
87eb8804de
@ -51,6 +51,7 @@ from .foilpresenterimport import FoilPresenterImport
|
||||
from .zionworximport import ZionWorxImport
|
||||
from .propresenterimport import ProPresenterImport
|
||||
from .worshipassistantimport import WorshipAssistantImport
|
||||
from .powerpraiseimport import PowerPraiseImport
|
||||
# Imports that might fail
|
||||
|
||||
|
||||
@ -160,17 +161,18 @@ class SongFormat(object):
|
||||
FoilPresenter = 8
|
||||
MediaShout = 9
|
||||
OpenSong = 10
|
||||
PowerSong = 11
|
||||
ProPresenter = 12
|
||||
SongBeamer = 13
|
||||
SongPro = 14
|
||||
SongShowPlus = 15
|
||||
SongsOfFellowship = 16
|
||||
SundayPlus = 17
|
||||
WordsOfWorship = 18
|
||||
WorshipAssistant = 19
|
||||
WorshipCenterPro = 20
|
||||
ZionWorx = 21
|
||||
PowerPraise = 11
|
||||
PowerSong = 12
|
||||
ProPresenter = 13
|
||||
SongBeamer = 14
|
||||
SongPro = 15
|
||||
SongShowPlus = 16
|
||||
SongsOfFellowship = 17
|
||||
SundayPlus = 18
|
||||
WordsOfWorship = 19
|
||||
WorshipAssistant = 20
|
||||
WorshipCenterPro = 21
|
||||
ZionWorx = 22
|
||||
|
||||
# Set optional attribute defaults
|
||||
__defaults__ = {
|
||||
@ -266,6 +268,12 @@ class SongFormat(object):
|
||||
'name': WizardStrings.OS,
|
||||
'prefix': 'openSong'
|
||||
},
|
||||
PowerPraise: {
|
||||
'class': PowerPraiseImport,
|
||||
'name': 'PowerPraise',
|
||||
'prefix': 'powerPraise',
|
||||
'filter': '%s (*.ppl)' % translate('SongsPlugin.ImportWizardForm', 'PowerPraise Song Files')
|
||||
},
|
||||
PowerSong: {
|
||||
'class': PowerSongImport,
|
||||
'name': 'PowerSong 1.0',
|
||||
@ -374,6 +382,7 @@ class SongFormat(object):
|
||||
SongFormat.FoilPresenter,
|
||||
SongFormat.MediaShout,
|
||||
SongFormat.OpenSong,
|
||||
SongFormat.PowerPraise,
|
||||
SongFormat.PowerSong,
|
||||
SongFormat.ProPresenter,
|
||||
SongFormat.SongBeamer,
|
||||
|
@ -40,7 +40,7 @@ from openlp.plugins.songs.lib import strip_rtf
|
||||
from .songimport import SongImport
|
||||
|
||||
|
||||
class PowerpraiseImport(SongImport):
|
||||
class PowerPraiseImport(SongImport):
|
||||
"""
|
||||
The :class:`PowerpraiseImport` class provides OpenLP with the
|
||||
ability to import Powerpraise song files.
|
||||
@ -56,7 +56,7 @@ class PowerpraiseImport(SongImport):
|
||||
|
||||
def process_song(self, root):
|
||||
self.set_defaults()
|
||||
self.title = root.general.title
|
||||
self.title = str(root.general.title)
|
||||
verse_order_list = []
|
||||
for item in root.order.item:
|
||||
verse_order_list.append(str(item))
|
||||
@ -66,11 +66,13 @@ class PowerpraiseImport(SongImport):
|
||||
count += 1
|
||||
verse_def = "v%d" % count
|
||||
original_verse_def = part.get('caption')
|
||||
verse_text = ""
|
||||
verse_text = []
|
||||
for slide in part.slide:
|
||||
if not hasattr(slide, 'line'):
|
||||
continue # No content
|
||||
for line in slide.line:
|
||||
verse_text += line
|
||||
self.add_verse(verse_text, verse_def)
|
||||
verse_text.append(str(line))
|
||||
self.add_verse('\n'.join(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():
|
||||
|
@ -39,12 +39,12 @@ TEST_PATH = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'powerpraisesongs'))
|
||||
|
||||
|
||||
class TestPowerpraiseFileImport(SongImportTestHelper):
|
||||
class TestPowerPraiseFileImport(SongImportTestHelper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.importer_class_name = 'PowerpraiseImport'
|
||||
self.importer_class_name = 'PowerPraiseImport'
|
||||
self.importer_module_name = 'powerpraiseimport'
|
||||
super(TestPowerpraiseFileImport, self).__init__(*args, **kwargs)
|
||||
super(TestPowerPraiseFileImport, self).__init__(*args, **kwargs)
|
||||
|
||||
def test_song_import(self):
|
||||
"""
|
||||
|
@ -3,15 +3,15 @@
|
||||
"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!",
|
||||
"Näher, mein Gott, zu Dir,\nsei meine Bitt'!\nNäher, o Herr, zu Dir\nmit jedem Schritt.\nNur an dem Herzen Dein\nkann ich geborgen sein;\ndeshalb die Bitte mein:\nNäher zu Dir!",
|
||||
"v1"
|
||||
],
|
||||
[
|
||||
"Näher, mein Gott, zu Dir!Ein jeder Tagsoll es neu zeigen mir,was er vermag:Wie seiner Gnade Macht,Erlösung hat gebracht,in uns're Sündennacht.Näher zu Dir!",
|
||||
"Näher, mein Gott, zu Dir!\nEin jeder Tag\nsoll es neu zeigen mir,\nwas er vermag:\nWie seiner Gnade Macht,\nErlösung hat gebracht,\nin uns're Sündennacht.\nNäher zu Dir!",
|
||||
"v2"
|
||||
],
|
||||
[
|
||||
"Näher, mein Gott, zu Dir!Dich bet' ich an.Wie vieles hast an mir,Du doch getan!Von Banden frei und los,ruh' ich in Deinem Schoss.Ja, Deine Gnad' ist gross!Näher zu Dir!",
|
||||
"Näher, mein Gott, zu Dir!\nDich bet' ich an.\nWie vieles hast an mir,\nDu doch getan!\nVon Banden frei und los,\nruh' ich in Deinem Schoss.\nJa, Deine Gnad' ist gross!\nNäher zu Dir!",
|
||||
"v3"
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user