Fix #544 (missed some config options)

Added lxml to stats sceen
pull/550/head
OzzieIsaacs 6 years ago
parent f0459d577b
commit 6f36eef51d

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

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

@ -1413,7 +1413,7 @@ def stats():
authors = len(db.session.query(db.Authors).all()) authors = len(db.session.query(db.Authors).all())
categorys = len(db.session.query(db.Tags).all()) categorys = len(db.session.query(db.Tags).all())
series = len(db.session.query(db.Series).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") vendorpath = os.path.join(config.get_main_dir, "vendor")
if sys.platform == "win32": if sys.platform == "win32":
kindlegen = os.path.join(vendorpath, u"kindlegen.exe") 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"]: if content.config_title_regex != to_save["config_title_regex"]:
content.config_title_regex = to_save["config_title_regex"] content.config_title_regex = to_save["config_title_regex"]
reboot_required = True 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: if "config_random_books" in to_save:
content.config_random_books = int(to_save["config_random_books"]) content.config_random_books = int(to_save["config_random_books"])
if "config_books_per_page" in to_save: if "config_books_per_page" in to_save:
content.config_books_per_page = int(to_save["config_books_per_page"]) 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 # Mature Content configuration
if "config_mature_content_tags" in to_save: if "config_mature_content_tags" in to_save:
content.config_mature_content_tags = to_save["config_mature_content_tags"].strip() 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, return render_title_template("config_edit.html", content=config, origin=origin,
gdrive=gdrive_support, gdriveError=gdriveError, gdrive=gdrive_support, gdriveError=gdriveError,
goodreads=goodreads_support, title=_(u"Basic Configuration")) 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 # Remote login configuration
content.config_remote_login = ("config_remote_login" in to_save and to_save["config_remote_login"] == "on") 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: if "config_goodreads_api_secret" in to_save:
content.config_goodreads_api_secret = to_save["config_goodreads_api_secret"] 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"]: if content.config_logfile != to_save["config_logfile"]:
# check valid path, only path or file # check valid path, only path or file
if os.path.dirname(to_save["config_logfile"]): if os.path.dirname(to_save["config_logfile"]):

Loading…
Cancel
Save