forked from openlp/openlp
Update GPL version, use constructor, add comment to signal unepected verse order
This commit is contained in:
parent
0c1eb50312
commit
a9d0e0909f
@ -8,7 +8,7 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
# Software Foundation; version 2 of the License. #
|
# Software Foundation; version 3 of the License. #
|
||||||
# #
|
# #
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
@ -39,15 +39,20 @@ class SingingTheFaithImport(SongImport):
|
|||||||
Import songs exported from SingingTheFaith
|
Import songs exported from SingingTheFaith
|
||||||
"""
|
"""
|
||||||
|
|
||||||
hints_available = False
|
def __init__(self, manager, **kwargs):
|
||||||
checks_needed = True
|
"""
|
||||||
hint_line = {}
|
Initialise the class.
|
||||||
hint_file_version = '0'
|
"""
|
||||||
hint_verse_order = ''
|
super(SingingTheFaithImport, self).__init__(manager, **kwargs)
|
||||||
hint_song_title = ''
|
self.hints_available = False
|
||||||
hint_comments = ''
|
self.checks_needed = True
|
||||||
hint_ccli = ''
|
self.hint_line = {}
|
||||||
hint_ignore_indent = False
|
self.hint_file_version = '0'
|
||||||
|
self.hint_verse_order = ''
|
||||||
|
self.hint_song_title = ''
|
||||||
|
self.hint_comments = ''
|
||||||
|
self.hint_ccli = ''
|
||||||
|
self.hint_ignore_indent = False
|
||||||
|
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
"""
|
"""
|
||||||
@ -251,9 +256,9 @@ class SingingTheFaithImport(SongImport):
|
|||||||
self.song_number = song_number
|
self.song_number = song_number
|
||||||
self.ccli_number = ccli
|
self.ccli_number = ccli
|
||||||
self.add_copyright(copyright)
|
self.add_copyright(copyright)
|
||||||
# If we have a chorus then the generated Verse order can not be used directly, but we can generate
|
# If we have a chorus then the generated Verse order can not be used directly, but we can generate
|
||||||
# one for two special cases - Verse followed by one chorus (to be repeated after every verse)
|
# one for two special cases - Verse followed by one chorus (to be repeated after every verse)
|
||||||
# of Chorus, followed by verses. If hints for ManualCheck or VerseOrder are supplied ignore this
|
# of Chorus, followed by verses. If hints for ManualCheck or VerseOrder are supplied ignore this
|
||||||
if has_chorus and not self.hint_verse_order and not self.checks_needed:
|
if has_chorus and not self.hint_verse_order and not self.checks_needed:
|
||||||
auto_verse_order_ok = False
|
auto_verse_order_ok = False
|
||||||
# Popular case V1 C2 V2 ...
|
# Popular case V1 C2 V2 ...
|
||||||
@ -273,11 +278,9 @@ class SingingTheFaithImport(SongImport):
|
|||||||
new_verse_order_list.append(self.verse_order_list[i])
|
new_verse_order_list.append(self.verse_order_list[i])
|
||||||
new_verse_order_list.append('c1')
|
new_verse_order_list.append('c1')
|
||||||
else:
|
else:
|
||||||
# Would like to notify, but want a warning, which we will do via the
|
|
||||||
# Check_needed mechanism, as log_error aborts input of that song.
|
|
||||||
# self.log_error(translate('SongsPlugin.SingingTheFaithImport', 'File %s' % file.name),
|
|
||||||
# 'Error: Strange verse order entry ' + self.verse_order_list[i])
|
|
||||||
auto_verse_order_ok = False
|
auto_verse_order_ok = False
|
||||||
|
self.add_comment('Importer detected unexpected verse order entry {}'.format(
|
||||||
|
self.verse_order_list[i]))
|
||||||
i += 1
|
i += 1
|
||||||
self.verse_order_list = new_verse_order_list
|
self.verse_order_list = new_verse_order_list
|
||||||
else:
|
else:
|
||||||
@ -301,6 +304,11 @@ class SingingTheFaithImport(SongImport):
|
|||||||
self.log_error(file.name)
|
self.log_error(file.name)
|
||||||
|
|
||||||
def read_hints(self, file, song_number):
|
def read_hints(self, file, song_number):
|
||||||
|
"""
|
||||||
|
Read the hints used to transform a particular song into version which can be projected,
|
||||||
|
or improve the transformation process beyond the standard heuristics. Not every song will
|
||||||
|
have, or need, hints.
|
||||||
|
"""
|
||||||
hintfound = False
|
hintfound = False
|
||||||
self.hint_verse_order = ''
|
self.hint_verse_order = ''
|
||||||
self.hint_line.clear()
|
self.hint_line.clear()
|
||||||
|
Loading…
Reference in New Issue
Block a user