forked from openlp/openlp
fixed service load
This commit is contained in:
parent
765a10d2ea
commit
a091fe9395
@ -686,14 +686,13 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
|||||||
zip_file = zipfile.ZipFile(file_name)
|
zip_file = zipfile.ZipFile(file_name)
|
||||||
for zip_info in zip_file.infolist():
|
for zip_info in zip_file.infolist():
|
||||||
try:
|
try:
|
||||||
ucsfile = zip_info.filename.decode(u'utf-8')
|
ucs_file = zip_info.filename
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
log.exception(u'file_name "%s" is not valid UTF-8' %
|
log.exception(u'file_name "%s" is not valid UTF-8' % zip_info.file_name)
|
||||||
zip_info.file_name.decode(u'utf-8', u'replace'))
|
|
||||||
critical_error_message_box(message=translate('OpenLP.ServiceManager',
|
critical_error_message_box(message=translate('OpenLP.ServiceManager',
|
||||||
'File is not a valid service.\n The content encoding is not UTF-8.'))
|
'File is not a valid service.\n The content encoding is not UTF-8.'))
|
||||||
continue
|
continue
|
||||||
osfile = ucsfile.replace(u'/', os.path.sep)
|
osfile = ucs_file.replace(u'/', os.path.sep)
|
||||||
if not osfile.startswith(u'audio'):
|
if not osfile.startswith(u'audio'):
|
||||||
osfile = os.path.split(osfile)[1]
|
osfile = os.path.split(osfile)[1]
|
||||||
log.debug(u'Extract file: %s', osfile)
|
log.debug(u'Extract file: %s', osfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user