From c626653092463be5c0c08224f06c928359a0fbb9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 27 Apr 2010 23:51:16 +0100 Subject: [PATCH] Fix bible reloading --- openlp/core/lib/settingsmanager.py | 13 +++++++++++-- openlp/plugins/bibles/lib/manager.py | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index c86170988..8d4b18ecd 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -23,6 +23,8 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import os + from PyQt4 import QtCore from openlp.core.utils import AppLocation @@ -151,15 +153,22 @@ class SettingsManager(object): return list @staticmethod - def get_files(suffix=None): + def get_files(section=None, suffix=None): """ Get a list of files from the data files path. + ``section`` + Defaults to *None*. The section of code getting the files - used + to load from section directory. + ``suffix`` Defaults to *None*. The extension to search for. """ + path = AppLocation.get_data_path() + if section: + path = os.path.join(path, section) try: - files = os.listdir(AppLocation.get_data_path()) + files = os.listdir(path) except: return [] if suffix: diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index bc96a81e5..ad9d4fcc6 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -126,7 +126,7 @@ class BibleManager(object): BibleDB class. """ log.debug(u'Reload bibles') - files = SettingsManager.get_files(self.suffix) + files = SettingsManager.get_files(u'bibles', self.suffix) log.debug(u'Bible Files %s', files) self.db_cache = {} for filename in files: