forked from openlp/openlp
Added support for ALL DreamBeam file formats.
This commit is contained in:
parent
4ce95e9d56
commit
9c11494364
@ -108,6 +108,22 @@ class DreamBeamImport(SongImport):
|
||||
('Invalid DreamBeam song file. Missing '
|
||||
'DreamSong tag.'))))
|
||||
continue
|
||||
if hasattr(song_xml, u'Version'):
|
||||
self.version = float(song_xml.Version.text)
|
||||
# Version numbers found in DreamBeam Source /FileTypes/Song.cs
|
||||
if self.version <= 0.49:
|
||||
if hasattr(song_xml.Text0, u'Text'):
|
||||
self.title = unicode(song_xml.Text0.Text.text)
|
||||
if hasattr(song_xml.Text1, u'Text'):
|
||||
self.lyrics = unicode(song_xml.Text1.Text.text)
|
||||
for verse in self.lyrics.split(u'\n\n\n'):
|
||||
self.addVerse(verse)
|
||||
if hasattr(song_xml.Text2, u'Text'):
|
||||
# DreamBeam does not have a copyright field, instead it
|
||||
# sometimes uses the author field
|
||||
self.addCopyright(unicode(song_xml.Text2.Text.text))
|
||||
self.parseAuthor(unicode(song_xml.Text2.Text.text))
|
||||
elif self.version >= 0.5:
|
||||
if hasattr(song_xml, u'Title'):
|
||||
self.title = unicode(song_xml.Title.text)
|
||||
if hasattr(song_xml, u'Author'):
|
||||
@ -127,11 +143,17 @@ class DreamBeamImport(SongImport):
|
||||
if hasattr(song_xml, u'Number'):
|
||||
self.songNumber = unicode(song_xml.Number.text)
|
||||
if hasattr(song_xml, u'Sequence'):
|
||||
for LyricsSequenceItem in song_xml.Sequence.iterchildren():
|
||||
for LyricsSequenceItem in (
|
||||
song_xml.Sequence.iterchildren()):
|
||||
self.verseOrderList.append(
|
||||
"%s%s" % (LyricsSequenceItem.get(u'Type')[:1],
|
||||
LyricsSequenceItem.get(u'Number')))
|
||||
if hasattr(song_xml, u'Notes'):
|
||||
self.comments = unicode(song_xml.Notes.text)
|
||||
else:
|
||||
log.exception(u'No valid version information.'
|
||||
'Invalid file %s' % file)
|
||||
self.logError(file, SongStrings.XMLSyntaxError)
|
||||
continue
|
||||
if not self.finish():
|
||||
self.logError(file)
|
||||
|
Loading…
Reference in New Issue
Block a user