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