From 52172044e6bdb963c847e212f2d427d30ffd87c2 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 26 Aug 2023 20:12:52 +0200 Subject: [PATCH] Fix deprecation warnings --- cps/admin.py | 2 +- cps/editbooks.py | 5 ++--- cps/services/SyncToken.py | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 93c1a3a9..045a9523 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -33,7 +33,7 @@ from functools import wraps from urllib.parse import urlparse from flask import Blueprint, flash, redirect, url_for, abort, request, make_response, send_from_directory, g, Response -from flask import Markup +from markupsafe import Markup from flask_login import login_required, current_user, logout_user from flask_babel import gettext as _ from flask_babel import get_locale, format_time, format_datetime, format_timedelta diff --git a/cps/editbooks.py b/cps/editbooks.py index 5a15740c..40f62713 100755 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -25,16 +25,15 @@ from datetime import datetime import json from shutil import copyfile from uuid import uuid4 -from markupsafe import escape # dependency of flask +from markupsafe import escape, Markup # dependency of flask from functools import wraps -import re try: from lxml.html.clean import clean_html, Cleaner except ImportError: clean_html = None -from flask import Blueprint, request, flash, redirect, url_for, abort, Markup, Response +from flask import Blueprint, request, flash, redirect, url_for, abort, Response from flask_babel import gettext as _ from flask_babel import lazy_gettext as N_ from flask_babel import get_locale diff --git a/cps/services/SyncToken.py b/cps/services/SyncToken.py index c44841c1..3af0e276 100644 --- a/cps/services/SyncToken.py +++ b/cps/services/SyncToken.py @@ -19,10 +19,9 @@ import sys from base64 import b64decode, b64encode -from jsonschema import validate, exceptions, __version__ -from datetime import datetime, timezone +from jsonschema import validate, exceptions +from datetime import datetime -from urllib.parse import unquote from flask import json from .. import logger