forked from openlp/openlp
Fixes
This commit is contained in:
parent
63d6536d52
commit
043665d154
@ -29,7 +29,7 @@ import logging
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
|
||||
translate, check_item_selected
|
||||
check_item_selected
|
||||
from openlp.core.lib.ui import UiStrings
|
||||
from openlp.plugins.custom.lib import CustomXMLParser
|
||||
from openlp.plugins.custom.lib.db import CustomSlide
|
||||
|
@ -147,8 +147,7 @@ class OpenSongImport(SongImport):
|
||||
continue
|
||||
log.info(u'Zip importing %s', parts[-1])
|
||||
self.import_wizard.incrementProgressBar(
|
||||
unicode(translate('SongsPlugin.ImportWizardForm',
|
||||
'Importing %s...')) % parts[-1])
|
||||
WizardStrings.ImportingType % parts[-1])
|
||||
songfile = z.open(song)
|
||||
self.do_import_file(songfile)
|
||||
if self.commit:
|
||||
|
@ -116,27 +116,27 @@ class SongShowPlusImport(SongImport):
|
||||
u'Importing %s' % (file_name), 0)
|
||||
songData = open(file, 'rb')
|
||||
while (1):
|
||||
blockKey, = struct.unpack("I",songData.read(4))
|
||||
blockKey, = struct.unpack("I", songData.read(4))
|
||||
# The file ends with 4 NUL's
|
||||
if blockKey == 0:
|
||||
break
|
||||
nextBlockStarts, = struct.unpack("I",songData.read(4))
|
||||
nextBlockStarts, = struct.unpack("I", songData.read(4))
|
||||
if blockKey == VERSE or blockKey == CHORUS:
|
||||
null, verseNo, = struct.unpack("BB",songData.read(2))
|
||||
null, verseNo, = struct.unpack("BB", songData.read(2))
|
||||
elif blockKey == CUSTOM_VERSE:
|
||||
null, verseNameLength, = struct.unpack("BB",
|
||||
songData.read(2))
|
||||
verseName = songData.read(verseNameLength)
|
||||
lengthDescriptorSize, = struct.unpack("B",songData.read(1))
|
||||
lengthDescriptorSize, = struct.unpack("B", songData.read(1))
|
||||
# Detect if/how long the length descriptor is
|
||||
if lengthDescriptorSize == 12:
|
||||
lengthDescriptor, = struct.unpack("I",songData.read(4))
|
||||
lengthDescriptor, = struct.unpack("I", songData.read(4))
|
||||
elif lengthDescriptorSize == 2:
|
||||
lengthDescriptor = 1
|
||||
elif lengthDescriptorSize == 9:
|
||||
lengthDescriptor = 0
|
||||
else:
|
||||
lengthDescriptor, = struct.unpack("B",songData.read(1))
|
||||
lengthDescriptor, = struct.unpack("B", songData.read(1))
|
||||
data = songData.read(lengthDescriptor)
|
||||
|
||||
if blockKey == TITLE:
|
||||
|
@ -66,7 +66,6 @@ import re
|
||||
|
||||
from lxml import etree, objectify
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.plugins.songs.lib import VerseType
|
||||
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic
|
||||
from openlp.plugins.songs.lib.ui import SongStrings
|
||||
|
Loading…
Reference in New Issue
Block a user