openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07628
[Merge] lp:~mahfiaz/openlp/some_fixes into lp:openlp
mahfiaz has proposed merging lp:~mahfiaz/openlp/some_fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/some_fixes/+merge/55613
A few fixes for errors on file handling
--
https://code.launchpad.net/~mahfiaz/openlp/some_fixes/+merge/55613
Your team OpenLP Core is requested to review the proposed merge of lp:~mahfiaz/openlp/some_fixes into lp:openlp.
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-03-26 19:00:47 +0000
+++ openlp/core/ui/servicemanager.py 2011-03-30 18:54:37 +0000
@@ -588,6 +588,21 @@
message=translate('OpenLP.ServiceManager',
'File could not be opened because it is corrupt.'))
log.exception(u'Problem loading service file %s' % fileName)
+ except zipfile.BadZipfile:
+ if os.path.getsize(fileName) == 0:
+ log.exception(u'Service file is zero sized: %s' % fileName)
+ QtGui.QMessageBox.information(self,
+ translate('OpenLP.ServiceManager', 'File Is Empty'),
+ translate('OpenLP.ServiceManager', 'This service file is '
+ 'zero size and does not contain any data.'))
+ else:
+ log.exception(u'Service file is cannot be extracted as zip: '
+ u'%s' % fileName)
+ QtGui.QMessageBox.information(self,
+ translate('OpenLP.ServiceManager', 'File Is Corrupt'),
+ translate('OpenLP.ServiceManager', 'This service file is '
+ 'either corrupt or is not an OpenLP 2 service file.'))
+ return
finally:
if fileTo:
fileTo.close()
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2011-03-24 19:04:02 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2011-03-30 18:54:37 +0000
@@ -269,6 +269,8 @@
if index is None:
index = VerseType.Other
verse[0][u'type'] = VerseType.Tags[index]
+ if verse[0][u'label'] == u'':
+ verse[0][u'label'] = u'1'
verse_def = u'%s%s' % (verse[0][u'type'], verse[0][u'label'])
item = QtGui.QTableWidgetItem(verse[1])
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def))
Follow ups