← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~mahfiaz/openlp/support-2060 into lp:openlp

 

mahfiaz has proposed merging lp:~mahfiaz/openlp/support-2060 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/support-2060/+merge/181958

Fixed bug http://support.openlp.org/issues/2060 -sensitive variable names in SundayPlus file importer.
-- 
https://code.launchpad.net/~mahfiaz/openlp/support-2060/+merge/181958
Your team OpenLP Core is requested to review the proposed merge of lp:~mahfiaz/openlp/support-2060 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/sundayplusimport.py'
--- openlp/plugins/songs/lib/sundayplusimport.py	2013-03-07 08:05:43 +0000
+++ openlp/plugins/songs/lib/sundayplusimport.py	2013-08-24 15:51:28 +0000
@@ -96,6 +96,7 @@
             if data[i:i + 1] == '#':
                 name_end = data.find(':', i + 1)
                 name = data[i + 1:name_end]
+                name = name.lower()
                 i = name_end + 1
                 while data[i:i + 1] == ' ':
                     i += 1
@@ -123,23 +124,23 @@
                 if not cell:
                     if name == 'title':
                         self.title = self.decode(self.unescape(value))
-                    elif name == 'Author':
+                    elif name == 'author':
                         author = self.decode(self.unescape(value))
                         if len(author):
                             self.addAuthor(author)
-                    elif name == 'Copyright':
+                    elif name == 'copyright':
                         self.copyright = self.decode(self.unescape(value))
-                    elif name[0:4] == 'CELL':
+                    elif name[0:4] == 'cell':
                         self.parse(value, cell = name[4:])
                 # We are in a verse group.
                 else:
-                    if name == 'MARKER_NAME':
+                    if name == 'marker_name':
                         value = value.strip()
                         if len(value):
                             verse_type = VerseType.tags[VerseType.from_loose_input(value[0])]
                             if len(value) >= 2 and value[-1] in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
                                 verse_type = "%s%s" % (verse_type, value[-1])
-                    elif name == 'Hotkey':
+                    elif name == 'hotkey':
                         # Hotkey always appears after MARKER_NAME, so it
                         # effectively overrides MARKER_NAME, if present.
                         if len(value) and value in HOTKEY_TO_VERSE_TYPE.keys():


Follow ups