Fix bible runtime data location

This commit is contained in:
Jon Tibble 2010-06-14 03:42:47 +01:00
parent ec4d54e66a
commit f54a423832
4 changed files with 8 additions and 9 deletions

View File

@ -322,8 +322,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
Load the list of Crosswalk and BibleGateway bibles. Load the list of Crosswalk and BibleGateway bibles.
""" """
#Load and store Crosswalk Bibles #Load and store Crosswalk Bibles
filepath = AppLocation.get_directory(AppLocation.PluginsDir) filepath = os.path.join(AppLocation.get_section_data_path(
filepath = os.path.join(filepath, u'bibles', u'resources') self.bibleplugin.settingsSection), u'resources')
try: try:
self.web_bible_list[WebDownload.Crosswalk] = {} self.web_bible_list[WebDownload.Crosswalk] = {}
books_file = open( books_file = open(

View File

@ -59,6 +59,7 @@ class BibleDB(QtCore.QObject):
""" """
log.info(u'BibleDB loaded') log.info(u'BibleDB loaded')
QtCore.QObject.__init__(self) QtCore.QObject.__init__(self)
self.bible_plugin = parent
if u'path' not in kwargs: if u'path' not in kwargs:
raise KeyError(u'Missing keyword argument "path".') raise KeyError(u'Missing keyword argument "path".')
if u'name' not in kwargs and u'file' not in kwargs: if u'name' not in kwargs and u'file' not in kwargs:

View File

@ -56,8 +56,8 @@ class HTTPBooks(object):
""" """
if HTTPBooks.cursor is None: if HTTPBooks.cursor is None:
filepath = os.path.join( filepath = os.path.join(
AppLocation.get_directory(AppLocation.PluginsDir), u'bibles', AppLocation.get_section_data_path(u'bibles'), u'resources',
u'resources', u'httpbooks.sqlite') u'httpbooks.sqlite')
conn = sqlite3.connect(filepath) conn = sqlite3.connect(filepath)
HTTPBooks.cursor = conn.cursor() HTTPBooks.cursor = conn.cursor()
return HTTPBooks.cursor return HTTPBooks.cursor
@ -288,8 +288,7 @@ class CWExtract(BibleCommon):
``chapter`` ``chapter``
Chapter number Chapter number
""" """
log.debug(u'get_bible_chapter %s,%s,%s', log.debug(u'get_bible_chapter %s,%s,%s', version, bookname, chapter)
version, bookname, chapter)
urlbookname = bookname.replace(u' ', u'-') urlbookname = bookname.replace(u' ', u'-')
chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % \ chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % \
(version, urlbookname.lower(), chapter) (version, urlbookname.lower(), chapter)

View File

@ -68,9 +68,8 @@ class OSISBible(BibleDB):
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>') self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
self.spaces_regex = re.compile(r'([ ]{2,})') self.spaces_regex = re.compile(r'([ ]{2,})')
self.books = {} self.books = {}
filepath = os.path.join( filepath = os.path.join(AppLocation.get_section_data_path(
AppLocation.get_directory(AppLocation.PluginsDir), u'bibles', self.bible_plugin.settingsSection), u'resources', u'osisbooks.csv')
u'resources', u'osisbooks.csv')
fbibles = None fbibles = None
try: try:
fbibles = open(filepath, u'r') fbibles = open(filepath, u'r')