openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #15021
[Merge] lp:~m2j/openlp/bug-953240 into lp:openlp
Meinert Jordan has proposed merging lp:~m2j/openlp/bug-953240 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~m2j/openlp/bug-953240/+merge/100517
Bug #953240: Merging subverse entries (e.g. v1a) at OpenSong import
--
https://code.launchpad.net/~m2j/openlp/bug-953240/+merge/100517
Your team OpenLP Core is requested to review the proposed merge of lp:~m2j/openlp/bug-953240 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/opensongimport.py'
--- openlp/plugins/songs/lib/opensongimport.py 2012-03-27 20:07:52 +0000
+++ openlp/plugins/songs/lib/opensongimport.py 2012-04-02 20:56:20 +0000
@@ -227,9 +227,17 @@
verses[verse_tag][verse_num][inst].append(this_line)
# done parsing
# add verses in original order
+ verse_joints = {}
for (verse_tag, verse_num, inst) in our_verse_order:
- verse_def = u'%s%s' % (verse_tag, verse_num)
lines = u'\n'.join(verses[verse_tag][verse_num][inst])
+ length = 0
+ while(length < len(verse_num) and verse_num[length].isnumeric()):
+ length += 1
+ verse_def = u'%s%s' % (verse_tag, verse_num[:length])
+ verse_joints[verse_def] = \
+ u'%s\n[---]\n%s' % (verse_joints[verse_def], lines) \
+ if verse_def in verse_joints else lines
+ for verse_def, lines in verse_joints.iteritems():
self.addVerse(lines, verse_def)
if not self.verses:
self.addVerse('')
Follow ups