Merge remote-tracking branch 'custom-dbpath'

pull/164/merge
OzzieIsaacs 8 years ago
commit 66181daf6d

@ -207,9 +207,10 @@ def backupCalibreDbAndOptionalDownload(drive, f=None):
if f: if f:
databaseFile.GetContentFile(f) databaseFile.GetContentFile(f)
def copyToDrive(drive, uploadFile, createRoot, replaceFiles, def copyToDrive(drive, uploadFile, createRoot, replaceFiles,
ignoreFiles=[], ignoreFiles=[],
parent=None, prevDir=''): parent=None, prevDir=''):
if not drive: if not drive:
drive=getDrive() drive=getDrive()
if drive.auth.access_token_expired: if drive.auth.access_token_expired:

@ -13,7 +13,7 @@ from flask_babel import gettext as _
import json import json
#from builtins import str #from builtins import str
dbpath = os.path.join(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + os.sep + ".." + os.sep), "app.db") dbpath = os.path.join(os.path.normpath(os.getenv("CALIBRE_DBPATH", os.path.dirname(os.path.realpath(__file__)) + os.sep + ".." + os.sep)), "app.db")
engine = create_engine('sqlite:///{0}'.format(dbpath), echo=False) engine = create_engine('sqlite:///{0}'.format(dbpath), echo=False)
Base = declarative_base() Base = declarative_base()

Loading…
Cancel
Save