openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #11716
[Merge] lp:~smpettit/openlp/import-settings into lp:openlp
Stevan Pettit has proposed merging lp:~smpettit/openlp/import-settings into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #838831 in OpenLP: "Import/Export Settings not working correctly for "shortcuts""
https://bugs.launchpad.net/openlp/+bug/838831
For more details, see:
https://code.launchpad.net/~smpettit/openlp/import-settings/+merge/73923
Bug #838831
Fixed problem with "shortcuts" section causing "The file you selected does appear to be a valid OpenLP...." error to be reported.
Added code to remove "@Invalid()" entries in the export file.
--
https://code.launchpad.net/~smpettit/openlp/import-settings/+merge/73923
Your team OpenLP Core is requested to review the proposed merge of lp:~smpettit/openlp/import-settings into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-08-29 16:54:09 +0000
+++ openlp/core/ui/mainwindow.py 2011-09-02 23:19:24 +0000
@@ -540,6 +540,7 @@
self.uiSettingsSection = u'user interface'
self.generalSettingsSection = u'general'
self.advancedlSettingsSection = u'advanced'
+ self.shortcutsSettingsSection = u'shortcuts'
self.servicemanagerSettingsSection = u'servicemanager'
self.songsSettingsSection = u'songs'
self.themesSettingsSection = u'themes'
@@ -925,6 +926,7 @@
settingSections.extend([self.generalSettingsSection])
settingSections.extend([self.advancedlSettingsSection])
settingSections.extend([self.uiSettingsSection])
+ settingSections.extend([self.shortcutsSettingsSection])
settingSections.extend([self.servicemanagerSettingsSection])
settingSections.extend([self.themesSettingsSection])
settingSections.extend([self.displayTagsSection])
@@ -1008,6 +1010,7 @@
settingSections.extend([self.generalSettingsSection])
settingSections.extend([self.advancedlSettingsSection])
settingSections.extend([self.uiSettingsSection])
+ settingSections.extend([self.shortcutsSettingsSection])
settingSections.extend([self.servicemanagerSettingsSection])
settingSections.extend([self.themesSettingsSection])
settingSections.extend([self.displayTagsSection])
@@ -1055,7 +1058,9 @@
exportIni = open(exportFileName, u'w')
for fileRecord in tempIni:
fileRecord = fileRecord.replace(u'%20', u' ')
- exportIni.write(fileRecord)
+ # Get rid of any invalid entries.
+ if not fileRecord.count(u'@Invalid()'):
+ exportIni.write(fileRecord)
tempIni.close()
exportIni.close()
os.remove(temp_file)
Follow ups