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 .zionworximport import ZionWorxImport
|
||||||
from .propresenterimport import ProPresenterImport
|
from .propresenterimport import ProPresenterImport
|
||||||
from .worshipassistantimport import WorshipAssistantImport
|
from .worshipassistantimport import WorshipAssistantImport
|
||||||
|
from .powerpraiseimport import PowerPraiseImport
|
||||||
# Imports that might fail
|
# Imports that might fail
|
||||||
|
|
||||||
|
|
||||||
@ -160,17 +161,18 @@ class SongFormat(object):
|
|||||||
FoilPresenter = 8
|
FoilPresenter = 8
|
||||||
MediaShout = 9
|
MediaShout = 9
|
||||||
OpenSong = 10
|
OpenSong = 10
|
||||||
PowerSong = 11
|
PowerPraise = 11
|
||||||
ProPresenter = 12
|
PowerSong = 12
|
||||||
SongBeamer = 13
|
ProPresenter = 13
|
||||||
SongPro = 14
|
SongBeamer = 14
|
||||||
SongShowPlus = 15
|
SongPro = 15
|
||||||
SongsOfFellowship = 16
|
SongShowPlus = 16
|
||||||
SundayPlus = 17
|
SongsOfFellowship = 17
|
||||||
WordsOfWorship = 18
|
SundayPlus = 18
|
||||||
WorshipAssistant = 19
|
WordsOfWorship = 19
|
||||||
WorshipCenterPro = 20
|
WorshipAssistant = 20
|
||||||
ZionWorx = 21
|
WorshipCenterPro = 21
|
||||||
|
ZionWorx = 22
|
||||||
|
|
||||||
# Set optional attribute defaults
|
# Set optional attribute defaults
|
||||||
__defaults__ = {
|
__defaults__ = {
|
||||||
@ -266,6 +268,12 @@ class SongFormat(object):
|
|||||||
'name': WizardStrings.OS,
|
'name': WizardStrings.OS,
|
||||||
'prefix': 'openSong'
|
'prefix': 'openSong'
|
||||||
},
|
},
|
||||||
|
PowerPraise: {
|
||||||
|
'class': PowerPraiseImport,
|
||||||
|
'name': 'PowerPraise',
|
||||||
|
'prefix': 'powerPraise',
|
||||||
|
'filter': '%s (*.ppl)' % translate('SongsPlugin.ImportWizardForm', 'PowerPraise Song Files')
|
||||||
|
},
|
||||||
PowerSong: {
|
PowerSong: {
|
||||||
'class': PowerSongImport,
|
'class': PowerSongImport,
|
||||||
'name': 'PowerSong 1.0',
|
'name': 'PowerSong 1.0',
|
||||||
@ -374,6 +382,7 @@ class SongFormat(object):
|
|||||||
SongFormat.FoilPresenter,
|
SongFormat.FoilPresenter,
|
||||||
SongFormat.MediaShout,
|
SongFormat.MediaShout,
|
||||||
SongFormat.OpenSong,
|
SongFormat.OpenSong,
|
||||||
|
SongFormat.PowerPraise,
|
||||||
SongFormat.PowerSong,
|
SongFormat.PowerSong,
|
||||||
SongFormat.ProPresenter,
|
SongFormat.ProPresenter,
|
||||||
SongFormat.SongBeamer,
|
SongFormat.SongBeamer,
|
||||||
|
@ -40,7 +40,7 @@ from openlp.plugins.songs.lib import strip_rtf
|
|||||||
from .songimport import SongImport
|
from .songimport import SongImport
|
||||||
|
|
||||||
|
|
||||||
class PowerpraiseImport(SongImport):
|
class PowerPraiseImport(SongImport):
|
||||||
"""
|
"""
|
||||||
The :class:`PowerpraiseImport` class provides OpenLP with the
|
The :class:`PowerpraiseImport` class provides OpenLP with the
|
||||||
ability to import Powerpraise song files.
|
ability to import Powerpraise song files.
|
||||||
@ -56,7 +56,7 @@ class PowerpraiseImport(SongImport):
|
|||||||
|
|
||||||
def process_song(self, root):
|
def process_song(self, root):
|
||||||
self.set_defaults()
|
self.set_defaults()
|
||||||
self.title = root.general.title
|
self.title = str(root.general.title)
|
||||||
verse_order_list = []
|
verse_order_list = []
|
||||||
for item in root.order.item:
|
for item in root.order.item:
|
||||||
verse_order_list.append(str(item))
|
verse_order_list.append(str(item))
|
||||||
@ -66,11 +66,13 @@ class PowerpraiseImport(SongImport):
|
|||||||
count += 1
|
count += 1
|
||||||
verse_def = "v%d" % count
|
verse_def = "v%d" % count
|
||||||
original_verse_def = part.get('caption')
|
original_verse_def = part.get('caption')
|
||||||
verse_text = ""
|
verse_text = []
|
||||||
for slide in part.slide:
|
for slide in part.slide:
|
||||||
|
if not hasattr(slide, 'line'):
|
||||||
|
continue # No content
|
||||||
for line in slide.line:
|
for line in slide.line:
|
||||||
verse_text += line
|
verse_text.append(str(line))
|
||||||
self.add_verse(verse_text, verse_def)
|
self.add_verse('\n'.join(verse_text), verse_def)
|
||||||
# Update verse name in verse order list
|
# Update verse name in verse order list
|
||||||
for i in range(len(verse_order_list)):
|
for i in range(len(verse_order_list)):
|
||||||
if verse_order_list[i].lower() == original_verse_def.lower():
|
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'))
|
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'powerpraisesongs'))
|
||||||
|
|
||||||
|
|
||||||
class TestPowerpraiseFileImport(SongImportTestHelper):
|
class TestPowerPraiseFileImport(SongImportTestHelper):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.importer_class_name = 'PowerpraiseImport'
|
self.importer_class_name = 'PowerPraiseImport'
|
||||||
self.importer_module_name = 'powerpraiseimport'
|
self.importer_module_name = 'powerpraiseimport'
|
||||||
super(TestPowerpraiseFileImport, self).__init__(*args, **kwargs)
|
super(TestPowerPraiseFileImport, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def test_song_import(self):
|
def test_song_import(self):
|
||||||
"""
|
"""
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
"verse_order_list": ["v1", "v2", "v3"],
|
"verse_order_list": ["v1", "v2", "v3"],
|
||||||
"verses": [
|
"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"
|
"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"
|
"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"
|
"v3"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user