1
0
mirror of https://github.com/janeczku/calibre-web.git synced 2024-11-26 08:51:05 +02:00

Fix #544 (missed some config options)

Added lxml to stats sceen
This commit is contained in:
OzzieIsaacs 2018-07-15 16:27:16 +02:00
parent f0459d577b
commit 6f36eef51d
3 changed files with 28 additions and 14 deletions

View File

@ -7,6 +7,11 @@ import os
from flask_babel import gettext as _
import comic
try:
from lxml.etree import LXML_VERSION as lxmlversion
except ImportError:
lxmlversion = None
__author__ = 'lemmsh'
logger = logging.getLogger("book_formats")
@ -120,9 +125,13 @@ def get_versions():
if not use_generic_pdf_cover:
IVersion=ImageVersion.MAGICK_VERSION
else:
IVersion=_(u'not installed')
IVersion = _(u'not installed')
if use_pdf_meta:
PVersion=PyPdfVersion
else:
PVersion=_(u'not installed')
return {'ImageVersion': IVersion, 'PyPdfVersion': PVersion}
if lxmlversion:
XVersion = '.'.join(map(str, lxmlversion))
else:
XVersion = _(u'not installed')
return {'ImageVersion': IVersion, 'PyPdfVersion': PVersion, 'LxmlVersion':XVersion}

View File

@ -98,6 +98,11 @@
<th>Pysqlite</th>
<td>v{{versions['pysqlite']}}</td>
</tr>
<tr>
<th>lxml</th>
<td>v{{versions['LxmlVersion']}}</td>
</tr>
</tbody>
</table>
{% endblock %}

View File

@ -1413,7 +1413,7 @@ def stats():
authors = len(db.session.query(db.Authors).all())
categorys = len(db.session.query(db.Tags).all())
series = len(db.session.query(db.Series).all())
versions = uploader.book_formats.get_versions()
config_anonbrowse = uploader.book_formats.get_versions()
vendorpath = os.path.join(config.get_main_dir, "vendor")
if sys.platform == "win32":
kindlegen = os.path.join(vendorpath, u"kindlegen.exe")
@ -2496,21 +2496,10 @@ def view_configuration():
if content.config_title_regex != to_save["config_title_regex"]:
content.config_title_regex = to_save["config_title_regex"]
reboot_required = True
if "config_log_level" in to_save:
content.config_log_level = int(to_save["config_log_level"])
if "config_random_books" in to_save:
content.config_random_books = int(to_save["config_random_books"])
if "config_books_per_page" in to_save:
content.config_books_per_page = int(to_save["config_books_per_page"])
content.config_uploading = 0
content.config_anonbrowse = 0
content.config_public_reg = 0
if "config_uploading" in to_save and to_save["config_uploading"] == "on":
content.config_uploading = 1
if "config_anonbrowse" in to_save and to_save["config_anonbrowse"] == "on":
content.config_anonbrowse = 1
if "config_public_reg" in to_save and to_save["config_public_reg"] == "on":
content.config_public_reg = 1
# Mature Content configuration
if "config_mature_content_tags" in to_save:
content.config_mature_content_tags = to_save["config_mature_content_tags"].strip()
@ -2654,6 +2643,15 @@ def configuration_helper(origin):
return render_title_template("config_edit.html", content=config, origin=origin,
gdrive=gdrive_support, gdriveError=gdriveError,
goodreads=goodreads_support, title=_(u"Basic Configuration"))
content.config_uploading = 0
content.config_anonbrowse = 0
content.config_public_reg = 0
if "config_uploading" in to_save and to_save["config_uploading"] == "on":
content.config_uploading = 1
if "config_anonbrowse" in to_save and to_save["config_anonbrowse"] == "on":
content.config_anonbrowse = 1
if "config_public_reg" in to_save and to_save["config_public_reg"] == "on":
content.config_public_reg = 1
# Remote login configuration
content.config_remote_login = ("config_remote_login" in to_save and to_save["config_remote_login"] == "on")
@ -2667,6 +2665,8 @@ def configuration_helper(origin):
if "config_goodreads_api_secret" in to_save:
content.config_goodreads_api_secret = to_save["config_goodreads_api_secret"]
if "config_log_level" in to_save:
content.config_log_level = int(to_save["config_log_level"])
if content.config_logfile != to_save["config_logfile"]:
# check valid path, only path or file
if os.path.dirname(to_save["config_logfile"]):