openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06986
[Merge] lp:~googol-hush/openlp/bibles into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/bibles into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/bibles/+merge/53176
Hello!
Remove corrupted bible databases when loading bibles. The bug which did not remove those files has been fixed (Bug #700859), but corrupted files may still exist on some computers...
--
https://code.launchpad.net/~googol-hush/openlp/bibles/+merge/53176
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/bibles into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py 2011-03-04 21:05:36 +0000
+++ openlp/plugins/bibles/lib/manager.py 2011-03-13 16:09:13 +0000
@@ -25,14 +25,14 @@
###############################################################################
import logging
+import os
from PyQt4 import QtCore
from openlp.core.lib import Receiver, SettingsManager, translate
-from openlp.core.utils import AppLocation
+from openlp.core.utils import AppLocation, delete_file
from openlp.plugins.bibles.lib import parse_reference
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
-
from csvbible import CSVBible
from http import HTTPBible
from opensong import OpenSongBible
@@ -144,6 +144,10 @@
for filename in files:
bible = BibleDB(self.parent, path=self.path, file=filename)
name = bible.get_name()
+ # Remove corrupted files.
+ if name is None:
+ delete_file(os.path.join(self.path, filename))
+ continue
log.debug(u'Bible Name: "%s"', name)
self.db_cache[name] = bible
# Look to see if lazy load bible exists and get create getter.
Follow ups