Fix Bible deletion on Windows

bzr-revno: 2051
Fixes: https://launchpad.net/bugs/1027254
This commit is contained in:
Jonathan Corwin 2012-09-05 22:20:08 +01:00
commit 64f0e31f69

View File

@ -208,24 +208,16 @@ class BibleManager(object):
def delete_bible(self, name): def delete_bible(self, name):
""" """
Delete a bible completly. Delete a bible completely.
``name`` ``name``
The name of the bible. The name of the bible.
""" """
log.debug(u'BibleManager.delete_bible("%s")', name) log.debug(u'BibleManager.delete_bible("%s")', name)
files = SettingsManager.get_files(self.settingsSection, bible = self.db_cache[name]
self.suffix) bible.session.close()
if u'alternative_book_names.sqlite' in files: bible.session = None
files.remove(u'alternative_book_names.sqlite') return delete_file(os.path.join(bible.path, bible.file))
for filename in files:
bible = BibleDB(self.parent, path=self.path, file=filename)
# Remove the bible files
if name == bible.get_name():
bible.session.close()
if delete_file(os.path.join(self.path, filename)):
return True
return False
def get_bibles(self): def get_bibles(self):
""" """