From: Roland Häder Date: Sun, 12 Jan 2025 02:10:42 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b68065be2450e63174c3ffa9268bc76e4adfc746;p=fba.git Continued: - encoding for reading config.json set to UTF-8 - removed unused imports --- diff --git a/fba/helpers/config.py b/fba/helpers/config.py index 426e9a6..215f0f0 100644 --- a/fba/helpers/config.py +++ b/fba/helpers/config.py @@ -30,7 +30,7 @@ logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) #logger.setLevel(logging.DEBUG) -with open("config.json") as f: +with open("config.json", 'r', encoding='utf-8') as f: logger.debug("Loading configuration file ...") _config = json.loads(f.read()) _config["max_crawl_depth"] = min(_config["max_crawl_depth"], (sys.getrecursionlimit() - 50)) diff --git a/fba/http/csrf.py b/fba/http/csrf.py index f3b8c56..e3884cc 100644 --- a/fba/http/csrf.py +++ b/fba/http/csrf.py @@ -21,7 +21,6 @@ import requests import validators from fba.helpers import blacklist -from fba.helpers import config from fba.helpers import cookies from fba.helpers import domain as domain_helper diff --git a/fba/http/federation.py b/fba/http/federation.py index b4b629a..7f2ce0d 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -34,7 +34,6 @@ from fba.http import csrf from fba.http import network from fba.http import nodeinfo -from fba.models import blocks from fba.models import instances from fba.networks import lemmy diff --git a/fba/networks/friendica.py b/fba/networks/friendica.py index 9329fe1..11ec498 100644 --- a/fba/networks/friendica.py +++ b/fba/networks/friendica.py @@ -19,7 +19,6 @@ import logging import bs4 from fba.helpers import blacklist -from fba.helpers import config from fba.helpers import domain as domain_helper from fba.helpers import tidyup diff --git a/fba/networks/mastodon.py b/fba/networks/mastodon.py index d748db4..ca24687 100644 --- a/fba/networks/mastodon.py +++ b/fba/networks/mastodon.py @@ -21,13 +21,11 @@ import bs4 from fba.helpers import blacklist from fba.helpers import blocks as blocks_helper -from fba.helpers import config from fba.helpers import domain as domain_helper from fba.helpers import tidyup from fba.http import network -from fba.models import blocks from fba.models import instances logging.basicConfig(level=logging.INFO) diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index 8abb90d..181c178 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -23,14 +23,12 @@ from fba import database from fba.helpers import blacklist from fba.helpers import blocks as blocks_helper -from fba.helpers import config from fba.helpers import domain as domain_helper from fba.helpers import tidyup from fba.http import network from fba.http import nodeinfo -from fba.models import blocks from fba.models import instances logging.basicConfig(level=logging.INFO) diff --git a/fba/utils.py b/fba/utils.py index b0702da..aa58a75 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -16,10 +16,7 @@ import hashlib import logging -from urllib.parse import urlparse - import bs4 -import requests import validators from fba.helpers import blacklist @@ -27,8 +24,6 @@ from fba.helpers import config from fba.helpers import domain as domain_helper from fba.helpers import tidyup -from fba.http import network - from fba.models import instances logging.basicConfig(level=logging.INFO)