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