openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07314
[Merge] lp:~googol-hush/openlp/fixes into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #598393 in OpenLP: "After adding a new image to a selected (image) item in the service manager it is not selected anymore"
https://bugs.launchpad.net/openlp/+bug/598393
Bug #719102 in OpenLP: "editing author after editing song causes traceback"
https://bugs.launchpad.net/openlp/+bug/719102
Bug #730979 in OpenLP: "Song export crashes"
https://bugs.launchpad.net/openlp/+bug/730979
Bug #738207 in OpenLP: "Attempting to import a non-theme file causes a stack trace"
https://bugs.launchpad.net/openlp/+bug/738207
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/54107
Hello,
- fixed Bug #738207
Not a very nice fix, but works.
--
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/54107
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2011-03-05 09:23:47 +0000
+++ openlp/core/ui/thememanager.py 2011-03-19 15:52:24 +0000
@@ -424,12 +424,12 @@
unicode(translate('OpenLP.ThemeManager',
'OpenLP Themes (*.theme *.otz)')))
log.info(u'New Themes %s', unicode(files))
+ if not files:
+ return
Receiver.send_message(u'cursor_busy')
- if files:
- for file in files:
- SettingsManager.set_last_dir(
- self.settingsSection, unicode(file))
- self.unzipTheme(file, self.path)
+ for file in files:
+ SettingsManager.set_last_dir(self.settingsSection, unicode(file))
+ self.unzipTheme(file, self.path)
self.loadThemes()
Receiver.send_message(u'cursor_normal')
@@ -502,16 +502,16 @@
def unzipTheme(self, filename, dir):
"""
Unzip the theme, remove the preview file if stored
- Generate a new preview fileCheck the XML theme version and upgrade if
+ Generate a new preview file. Check the XML theme version and upgrade if
necessary.
"""
log.debug(u'Unzipping theme %s', filename)
filename = unicode(filename)
zip = None
outfile = None
+ filexml = None
try:
zip = zipfile.ZipFile(filename)
- filexml = None
themename = None
for file in zip.namelist():
ucsfile = file_is_unicode(file)
@@ -547,7 +547,7 @@
else:
outfile = open(fullpath, u'wb')
outfile.write(zip.read(file))
- except (IOError, NameError):
+ except (IOError, NameError, zipfile.BadZipfile):
critical_error_message_box(
translate('OpenLP.ThemeManager', 'Validation Error'),
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
@@ -562,7 +562,9 @@
if filexml:
theme = self._createThemeFromXml(filexml, self.path)
self.generateAndSaveImage(dir, themename, theme)
- else:
+ # Only show the error message, when IOError was not raised (in this
+ # case the error message has already been shown).
+ elif zip is not None:
critical_error_message_box(
translate('OpenLP.ThemeManager', 'Validation Error'),
translate('OpenLP.ThemeManager',
Follow ups