forked from openlp/openlp
Fix Bible deletion on Windows
bzr-revno: 2051 Fixes: https://launchpad.net/bugs/1027254
This commit is contained in:
commit
64f0e31f69
@ -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)
|
|
||||||
if u'alternative_book_names.sqlite' in files:
|
|
||||||
files.remove(u'alternative_book_names.sqlite')
|
|
||||||
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()
|
bible.session.close()
|
||||||
if delete_file(os.path.join(self.path, filename)):
|
bible.session = None
|
||||||
return True
|
return delete_file(os.path.join(bible.path, bible.file))
|
||||||
return False
|
|
||||||
|
|
||||||
def get_bibles(self):
|
def get_bibles(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user