diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index a721fabf6..f21d8df50 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -377,7 +377,7 @@ class MediaManagerItem(QtGui.QWidget): """ names = [] for count in range(0, self.listView.count()): - names.append(self.listView.item(count).text()) + names.append(unicode(self.listView.item(count).text())) newFiles = [] duplicatesFound = False for file in files: @@ -396,7 +396,7 @@ class MediaManagerItem(QtGui.QWidget): critical_error_message_box( UiStrings().Duplicate, unicode(translate('OpenLP.MediaManagerItem', - 'Duplicate files found on import and ignored.'))) + 'Duplicate files were found on import and were ignored.'))) def contextMenu(self, point): item = self.listView.itemAt(point) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ad1161e0d..20edab792 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -586,8 +586,8 @@ class ServiceManager(QtGui.QWidget): fileTo = None try: zip = zipfile.ZipFile(fileName) - for file in zip.namelist(): - ucsfile = file_is_unicode(file) + for zipinfo in zip.infolist(): + ucsfile = file_is_unicode(zipinfo.filename) if not ucsfile: critical_error_message_box( message=translate('OpenLP.ServiceManager', @@ -595,14 +595,11 @@ class ServiceManager(QtGui.QWidget): 'The content encoding is not UTF-8.')) continue osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile)) - filePath = os.path.join(self.servicePath, - os.path.split(osfile)[1]) - fileTo = open(filePath, u'wb') - fileTo.write(zip.read(file)) - fileTo.flush() - fileTo.close() - if filePath.endswith(u'osd'): - p_file = filePath + filename_only = os.path.split(osfile)[1] + zipinfo.filename = filename_only + zip.extract(zipinfo, self.servicePath) + if filename_only.endswith(u'osd'): + p_file = os.path.join(self.servicePath, filename_only) if 'p_file' in locals(): Receiver.send_message(u'cursor_busy') fileTo = open(p_file, u'r') diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 290da104c..2d8e16c4c 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -218,7 +218,7 @@ class BSExtract(object): send_error_message(u'parse') return None content = content.find(u'div').findAll(u'div') - verse_number = re.compile(r'v(\d{1,2})(\d{3})(\d{3}) verse') + verse_number = re.compile(r'v(\d{1,2})(\d{3})(\d{3}) verse.*') verses = {} for verse in content: Receiver.send_message(u'openlp_process_events') diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index e2996ff8f..1b0ca316e 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -184,10 +184,11 @@ class VerseType(object): verse_index = VerseType.from_translated_string(verse_name) if verse_index is None: verse_index = VerseType.from_string(verse_name) - if verse_index is None: - verse_index = VerseType.from_translated_tag(verse_name) - if verse_index is None: - verse_index = VerseType.from_tag(verse_name) + elif len(verse_name) == 1: + if verse_index is None: + verse_index = VerseType.from_translated_tag(verse_name) + if verse_index is None: + verse_index = VerseType.from_tag(verse_name) return verse_index def retrieve_windows_encoding(recommendation=None): diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 7fca88262..632170807 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -190,7 +190,10 @@ class OpenSongImport(SongImport): # the verse tag verse_tag = content verse_num = u'1' - verse_index = VerseType.from_loose_input(verse_tag) + if len(verse_tag) == 0: + verse_index = 0 + else: + verse_index = VerseType.from_loose_input(verse_tag) verse_tag = VerseType.Tags[verse_index] inst = 1 if [verse_tag, verse_num, inst] in our_verse_order \ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index c50df8752..591f71c10 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -103,6 +103,8 @@ class SongShowPlusImport(SongImport): return self.import_wizard.progressBar.setMaximum(len(self.import_source)) for file in self.import_source: + if self.stop_import_flag: + return self.sspVerseOrderList = [] otherCount = 0 otherList = {} diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index e2a5820a5..4cfb81cb1 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -105,6 +105,8 @@ class WowImport(SongImport): if isinstance(self.import_source, list): self.import_wizard.progressBar.setMaximum(len(self.import_source)) for file in self.import_source: + if self.stop_import_flag: + return file_name = os.path.split(file)[1] # Get the song title self.title = file_name.rpartition(u'.')[0]