From e37ab565ad8a86f56c4722d3a5c41969475914f5 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 28 Feb 2010 22:50:14 +0200 Subject: [PATCH] A fix to the OSIS importer, and added the version file. --- openlp.pyw | 5 +++-- openlp/.version | 1 + openlp/plugins/bibles/lib/osis.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 openlp/.version diff --git a/openlp.pyw b/openlp.pyw index 5c18486b6..cdf762c1c 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -32,6 +32,7 @@ from logging import FileHandler from optparse import OptionParser from PyQt4 import QtCore, QtGui +import openlp from openlp.core.lib import Receiver, str_to_bool from openlp.core.resources import qInitResources from openlp.core.ui import MainWindow, SplashScreen, ScreenList @@ -77,8 +78,8 @@ class OpenLP(QtGui.QApplication): Run the OpenLP application. """ #Load and store current Application Version - filepath = os.path.split(os.path.abspath(__file__))[0] - filepath = os.path.abspath(os.path.join(filepath, u'version.txt')) + filepath = os.path.split(os.path.abspath(openlp.__file__))[0] + filepath = os.path.abspath(os.path.join(filepath, u'.version')) fversion = None try: fversion = open(filepath, u'r') diff --git a/openlp/.version b/openlp/.version new file mode 100644 index 000000000..90a9f5c8f --- /dev/null +++ b/openlp/.version @@ -0,0 +1 @@ +1.9.0-bzr718 \ No newline at end of file diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index cfa68b213..41f11e8a0 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -30,6 +30,8 @@ import chardet import codecs import re +from PyQt4 import QtCore + from openlp.core.lib import Receiver from db import BibleDB @@ -94,10 +96,11 @@ class OSISBible(BibleDB): Loads a Bible from file. """ log.debug(u'Starting OSIS import from "%s"' % self.filename) + self.wizard.incrementProgressBar(u'Detecting encoding (this may take a few minutes)...') detect_file = None try: detect_file = open(self.filename, u'r') - details = chardet.detect(detect_file.read(3000)) + details = chardet.detect(detect_file.read()) except: log.exception(u'Failed to detect OSIS file encoding') return