forked from openlp/openlp
Tweaks from review
This commit is contained in:
parent
a8dd0f5ddc
commit
ebf3ce587d
@ -19,5 +19,3 @@ _eric4project
|
||||
*.qm
|
||||
openlp/core/resources.py.old
|
||||
*.qm
|
||||
import_lots_errors.txt
|
||||
../import_lots_errors.txt
|
||||
|
@ -119,7 +119,7 @@ class OpenSongImport(SongImport):
|
||||
multiple opensong files. If `self.commit` is set False, the
|
||||
import will not be committed to the database (useful for test scripts).
|
||||
"""
|
||||
success = False
|
||||
success = True
|
||||
numfiles = 0
|
||||
for filename in self.filenames:
|
||||
ext = os.path.splitext(filename)[1]
|
||||
@ -157,7 +157,8 @@ class OpenSongImport(SongImport):
|
||||
if self.stop_import_flag:
|
||||
success = False
|
||||
break
|
||||
else: # not a zipfile
|
||||
else:
|
||||
# not a zipfile
|
||||
log.info('Direct import %s', filename)
|
||||
self.import_wizard.incrementProgressBar(
|
||||
unicode(translate('SongsPlugin.ImportWizardForm',
|
||||
@ -244,9 +245,7 @@ class OpenSongImport(SongImport):
|
||||
if thisline[0].isdigit():
|
||||
versenum = thisline[0]
|
||||
words = thisline[1:].strip()
|
||||
if words is None:# and \
|
||||
#versenum is not None and \
|
||||
#versetype is not None:
|
||||
if words is None:
|
||||
words = thisline
|
||||
if not versenum:
|
||||
versenum = u'1'
|
||||
@ -295,9 +294,11 @@ class OpenSongImport(SongImport):
|
||||
log.warn(u'No verse order available (either explicit or inferred) for %s, skipping.', self.title)
|
||||
for tag in order:
|
||||
if tag[0].isdigit():
|
||||
tag = u'V' + tag # Assume it's a verse if it has no prefix
|
||||
# Assume it's a verse if it has no prefix
|
||||
tag = u'V' + tag
|
||||
elif not re.search('\d+', tag):
|
||||
tag = tag + u'1' # Assume it's no.1 if there's no digits
|
||||
# Assume it's no.1 if there's no digits
|
||||
tag = tag + u'1'
|
||||
if not versetags.has_key(tag):
|
||||
log.info(u'Got order %s but not in versetags, dropping this item from presentation order', tag)
|
||||
else:
|
||||
|
@ -291,7 +291,6 @@ class SongImport(QtCore.QObject):
|
||||
versetag = newversetag
|
||||
sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext)
|
||||
song.search_lyrics += u' ' + self.remove_punctuation(versetext)
|
||||
# print verses_changed_to_other
|
||||
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||
for i, current_verse_tag in enumerate(self.verse_order_list):
|
||||
if verses_changed_to_other.has_key(current_verse_tag):
|
||||
|
Loading…
Reference in New Issue
Block a user