[chore] fix some docstring typos (#4815)

This commit is contained in:
Jost Alemann 2025-05-20 19:03:54 +00:00 committed by GitHub
parent 6ec554cb5b
commit 7420706a50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 20 additions and 20 deletions

View File

@ -21,7 +21,7 @@ log: logging.Logger = logging.getLogger("searx.answerers")
@dataclass
class AnswererInfo:
"""Object that holds informations about an answerer, these infos are shown
"""Object that holds information about an answerer, these infos are shown
to the user in the Preferences menu.
To be able to translate the information into other languages, the text must
@ -53,7 +53,7 @@ class Answerer(abc.ABC):
@abc.abstractmethod
def info(self) -> AnswererInfo:
"""Informations about the *answerer*, see :py:obj:`AnswererInfo`."""
"""Information about the *answerer*, see :py:obj:`AnswererInfo`."""
class ModuleAnswerer(Answerer):

View File

@ -319,9 +319,9 @@ def dict_deepupdate(base_dict: dict, upd_dict: dict, names=None):
"""
# pylint: disable=too-many-branches
if not isinstance(base_dict, dict):
raise TypeError("argument 'base_dict' is not a ditionary type")
raise TypeError("argument 'base_dict' is not a dictionary type")
if not isinstance(upd_dict, dict):
raise TypeError("argument 'upd_dict' is not a ditionary type")
raise TypeError("argument 'upd_dict' is not a dictionary type")
if names is None:
names = []

View File

@ -42,7 +42,7 @@ class ExpireCacheCfg(msgspec.Struct): # pylint: disable=too-few-public-methods
DB will be created in `/tmp/sxng_cache_{self.name}.db`"""
MAX_VALUE_LEN: int = 1024 * 10
"""Max lenght of a *serialized* value."""
"""Max length of a *serialized* value."""
MAXHOLD_TIME: int = 60 * 60 * 24 * 7 # 7 days
"""Hold time (default in sec.), after which a value is removed from the cache."""
@ -80,7 +80,7 @@ class ExpireCacheCfg(msgspec.Struct): # pylint: disable=too-few-public-methods
@dataclasses.dataclass
class ExpireCacheStats:
"""Dataclass wich provides information on the status of the cache."""
"""Dataclass which provides information on the status of the cache."""
cached_items: dict[str, list[tuple[str, typing.Any, int]]]
"""Values in the cache mapped by context name.

View File

@ -79,7 +79,7 @@ class EngineCache:
<searx.cache.ExpireCacheSQLite>`).
In the :origin:`searx/engines/demo_offline.py` engine you can find an
exemplary implementation of such a cache other exaples are implemeted
exemplary implementation of such a cache other examples are implemented
in:
- :origin:`searx/engines/radio_browser.py`

View File

@ -156,7 +156,7 @@ def parse_image_item(item):
def parse_video_item(item):
# in video items, the title is more or less a "content description", we try
# to reduce the lenght of the title ..
# to reduce the length of the title ..
title = item["title"]
content = ""

View File

@ -77,7 +77,7 @@ def response(resp):
elif item_type == 'video':
results.append(_video(item))
else:
logger.error("unknow result type: %s", item_type)
logger.error("unknown result type: %s", item_type)
return results

View File

@ -42,7 +42,7 @@ class SXNG_Request(flask.Request):
"""list of searx.plugins.Plugin.id (the id of the plugins)"""
preferences: "searx.preferences.Preferences"
"""The prefernces of the request."""
"""The preferences of the request."""
errors: list[str]
"""A list of errors (translated text) added by :py:obj:`searx.webapp` in

View File

@ -140,7 +140,7 @@ class FaviconCacheConfig(msgspec.Struct): # pylint: disable=too-few-public-meth
@dataclasses.dataclass
class FaviconCacheStats:
"""Dataclass wich provides information on the status of the cache."""
"""Dataclass which provides information on the status of the cache."""
favicons: int | None = None
bytes: int | None = None
@ -387,7 +387,7 @@ CREATE TABLE IF NOT EXISTS blob_map (
self.properties.set("LAST_MAINTENANCE", "") # hint: this (also) sets the m_time of the property!
# Do maintenance tasks. This can be take a little more time, to avoid
# DB locks, etablish a new DB connecton.
# DB locks, establish a new DB connection.
with self.connect() as conn:

View File

@ -8,7 +8,7 @@ class OpenMetricsFamily: # pylint: disable=too-few-public-methods
The type_hint parameter must be one of 'counter', 'gauge', 'histogram', 'summary'.
The help_hint parameter is a short string explaining the metric.
The data_info parameter is a dictionary of descriptionary parameters for the data point (e.g. request method/path).
The data parameter is a flat list of the actual data in shape of a primive type.
The data parameter is a flat list of the actual data in shape of a primitive type.
See https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md for more information.
"""

View File

@ -26,7 +26,7 @@ log: logging.Logger = logging.getLogger("searx.plugins")
@dataclass
class PluginInfo:
"""Object that holds informations about a *plugin*, these infos are shown to
"""Object that holds information about a *plugin*, these infos are shown to
the user in the Preferences menu.
To be able to translate the information into other languages, the text must
@ -85,7 +85,7 @@ class Plugin(abc.ABC):
constructor (if not already set in the subclass)."""
info: PluginInfo
"""Informations about the *plugin*, see :py:obj:`PluginInfo`."""
"""Information about the *plugin*, see :py:obj:`PluginInfo`."""
fqn: str = ""
@ -129,8 +129,8 @@ class Plugin(abc.ABC):
def init(self, app: "flask.Flask") -> bool: # pylint: disable=unused-argument
"""Initialization of the plugin, the return value decides whether this
plugin is active or not. Initialization only takes place once, at the
time the WEB application is set up. The base methode always returns
``True``, the methode can be overwritten in the inheritances,
time the WEB application is set up. The base method always returns
``True``, the method can be overwritten in the inheritances,
- ``True`` plugin is active
- ``False`` plugin is inactive

View File

@ -114,7 +114,7 @@ class SQLiteAppl(abc.ABC):
"""
SQLITE_JOURNAL_MODE = "WAL"
"""``SQLiteAppl`` applications are optimzed for WAL_ mode, its not recommend
"""``SQLiteAppl`` applications are optimized for WAL_ mode, its not recommend
to change the journal mode (see :py:obj:`SQLiteAppl.tear_down`).
.. _WAL: https://sqlite.org/wal.html
@ -145,7 +145,7 @@ class SQLiteAppl(abc.ABC):
- https://github.com/python/cpython/issues/118172
- https://github.com/python/cpython/issues/123873
The workaround for SQLite3 multithreading cache inconsistency ist to set
The workaround for SQLite3 multithreading cache inconsistency is to set
option ``cached_statements`` to ``0`` by default.
"""

View File

@ -1276,7 +1276,7 @@ uWSGI_distro_setup() {
# Fedora runs uWSGI in emperor-tyrant mode: in Tyrant mode the
# Emperor will run the vassal using the UID/GID of the vassal
# configuration file [1] (user and group of the app .ini file).
# There are some quirks abbout additional POSIX groups in uWSGI
# There are some quirks about additional POSIX groups in uWSGI
# 2.0.x, read at least: https://github.com/unbit/uwsgi/issues/2099
uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available"
uWSGI_APPS_ENABLED="${uWSGI_SETUP}.d"