From: Michael Tremer Date: Mon, 29 Dec 2025 13:36:56 +0000 (+0000) Subject: backend: Support passing the configuration as a path X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d062e0973c681580638a3d29edc63d9eeb2d3384;p=dbl.git backend: Support passing the configuration as a path Signed-off-by: Michael Tremer --- diff --git a/src/dnsbl/__init__.py b/src/dnsbl/__init__.py index 5b5f043..dc67c80 100644 --- a/src/dnsbl/__init__.py +++ b/src/dnsbl/__init__.py @@ -21,6 +21,7 @@ import configparser import functools import httpx +import io import logging import sqlmodel @@ -56,7 +57,10 @@ class Backend(object): # Parse the file if config: - c.read_file(config) + if isinstance(config, io.RawIOBase): + c.read_file(config) + else: + c.read([config]) return c