mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	Merge branch 'master' into Develop
This commit is contained in:
		
							
								
								
									
										20
									
								
								cps/about.py
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								cps/about.py
									
									
									
									
									
								
							| @@ -25,8 +25,15 @@ import platform | ||||
| import sqlite3 | ||||
| from collections import OrderedDict | ||||
|  | ||||
| import babel, pytz, requests, sqlalchemy | ||||
| import werkzeug, flask, flask_login, flask_principal, jinja2 | ||||
| import babel | ||||
| import pytz | ||||
| import requests | ||||
| import sqlalchemy | ||||
| import werkzeug | ||||
| import flask | ||||
| import flask_login | ||||
| import flask_principal | ||||
| import jinja2 | ||||
| from flask_babel import gettext as _ | ||||
| try: | ||||
|     from flask_wtf import __version__ as flaskwtf_version | ||||
| @@ -58,12 +65,6 @@ try: | ||||
| except ImportError: | ||||
|     greenlet_Version = None | ||||
|  | ||||
| try: | ||||
|     from scholarly import scholarly | ||||
|     scholarly_version = _(u'installed') | ||||
| except ImportError: | ||||
|     scholarly_version = _(u'not installed') | ||||
|  | ||||
| from . import services | ||||
|  | ||||
| about = flask.Blueprint('about', __name__) | ||||
| @@ -105,7 +106,6 @@ if not ret: | ||||
|         iso639=isoLanguages.__version__, | ||||
|         pytz=pytz.__version__, | ||||
|         Unidecode=unidecode_version, | ||||
|         Scholarly=scholarly_version, | ||||
|         Flask_SimpleLDAP=u'installed' if bool(services.ldap) else None, | ||||
|         python_LDAP=services.ldapVersion if bool(services.ldapVersion) else None, | ||||
|         Goodreads=u'installed' if bool(services.goodreads_support) else None, | ||||
| @@ -128,12 +128,14 @@ else: | ||||
|     _VERSIONS.update(ret) | ||||
|     _VERSIONS.update(uploader.get_versions(False)) | ||||
|  | ||||
|  | ||||
| def collect_stats(): | ||||
|     _VERSIONS['ebook converter'] = _(converter.get_calibre_version()) | ||||
|     _VERSIONS['unrar'] = _(converter.get_unrar_version()) | ||||
|     _VERSIONS['kepubify'] = _(converter.get_kepubify_version()) | ||||
|     return _VERSIONS | ||||
|  | ||||
|  | ||||
| @about.route("/stats") | ||||
| @flask_login.login_required | ||||
| def stats(): | ||||
|   | ||||
| @@ -33,13 +33,6 @@ try: | ||||
| except ImportError: | ||||
|     pass | ||||
|  | ||||
| # Improve this to check if scholarly is available in a global way, like other pythonic libraries | ||||
| try: | ||||
|     from scholarly import scholarly | ||||
|     have_scholar = True | ||||
| except ImportError: | ||||
|     have_scholar = False | ||||
|  | ||||
| from flask import Blueprint, request, flash, redirect, url_for, abort, Markup, Response | ||||
| from flask_babel import gettext as _ | ||||
| from flask_login import current_user, login_required | ||||
|   | ||||
| @@ -19,7 +19,14 @@ import itertools | ||||
| from typing import Dict, List, Optional | ||||
| from urllib.parse import quote | ||||
|  | ||||
| try: | ||||
|     from fake_useragent.errors import FakeUserAgentError | ||||
| except (ImportError): | ||||
|     FakeUserAgentError = BaseException | ||||
| try: | ||||
|     from scholarly import scholarly | ||||
| except FakeUserAgentError: | ||||
|     raise ImportError("No module named 'scholarly'") | ||||
|  | ||||
| from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ozzie Isaacs
					Ozzie Isaacs