From 1a83ad713cb9746ec57c3e9a518ce445f94911de Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sat, 25 Feb 2017 09:02:59 +0100 Subject: [PATCH] Additional version info for sqlite database --- cps/db.py | 2 +- cps/static/js/main.js | 2 +- cps/templates/stats.html | 9 ++++++++- cps/ub.py | 1 - cps/web.py | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cps/db.py b/cps/db.py index e4082a16..f25848c7 100755 --- a/cps/db.py +++ b/cps/db.py @@ -294,7 +294,7 @@ def setup_db(): return False dbpath = os.path.join(config.config_calibre_dir, "metadata.db") - engine = create_engine('sqlite:///{0}'.format(dbpath.encode('utf-8')), echo=False) + engine = create_engine('sqlite:///{0}'.format(dbpath.encode('utf-8')), echo=False, isolation_level="SERIALIZABLE") try: conn = engine.connect() diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 0a184530..8b0b099f 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -50,7 +50,7 @@ $(function() { }); $("#check_for_update").click(function() { var button_text = $("#check_for_update").html(); - $("#check_for_update").html('Checking...'); + $("#check_for_update").html('...'); $.ajax({ dataType: 'json', url: window.location.pathname+"/../../get_update_status", diff --git a/cps/templates/stats.html b/cps/templates/stats.html index 7ab72092..4b08afda 100644 --- a/cps/templates/stats.html +++ b/cps/templates/stats.html @@ -78,7 +78,14 @@ Requests v{{versions['requests']}} - + + SQlite + v{{versions['sqlite']}} + + + Pysqlite + v{{versions['pysqlite']}} + diff --git a/cps/ub.py b/cps/ub.py index f5207f06..653454ce 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -7,7 +7,6 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import * from flask_login import AnonymousUserMixin import os -import traceback import logging from werkzeug.security import generate_password_hash from flask_babel import gettext as _ diff --git a/cps/web.py b/cps/web.py index 06930901..5d218ecc 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1055,6 +1055,8 @@ def stats(): versions['tornado'] = tornadoVersion versions['iso639'] = iso639Version versions['requests'] = requests.__version__ + versions['pysqlite'] = db.engine.dialect.dbapi.version + versions['sqlite'] = db.engine.dialect.dbapi.sqlite_version return render_title_template('stats.html', bookcounter=counter, authorcounter=authors, versions=versions, categorycounter=categorys, seriecounter=series, title=_(u"Statistics"))