mirror of
https://github.com/searxng/searxng.git
synced 2025-05-23 17:02:57 -04:00
[chore] fix some docstring typos (#4815)
This commit is contained in:
parent
6ec554cb5b
commit
7420706a50
@ -21,7 +21,7 @@ log: logging.Logger = logging.getLogger("searx.answerers")
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class AnswererInfo:
|
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 the user in the Preferences menu.
|
||||||
|
|
||||||
To be able to translate the information into other languages, the text must
|
To be able to translate the information into other languages, the text must
|
||||||
@ -53,7 +53,7 @@ class Answerer(abc.ABC):
|
|||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def info(self) -> AnswererInfo:
|
def info(self) -> AnswererInfo:
|
||||||
"""Informations about the *answerer*, see :py:obj:`AnswererInfo`."""
|
"""Information about the *answerer*, see :py:obj:`AnswererInfo`."""
|
||||||
|
|
||||||
|
|
||||||
class ModuleAnswerer(Answerer):
|
class ModuleAnswerer(Answerer):
|
||||||
|
@ -319,9 +319,9 @@ def dict_deepupdate(base_dict: dict, upd_dict: dict, names=None):
|
|||||||
"""
|
"""
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
if not isinstance(base_dict, dict):
|
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):
|
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:
|
if names is None:
|
||||||
names = []
|
names = []
|
||||||
|
@ -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`"""
|
DB will be created in `/tmp/sxng_cache_{self.name}.db`"""
|
||||||
|
|
||||||
MAX_VALUE_LEN: int = 1024 * 10
|
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
|
MAXHOLD_TIME: int = 60 * 60 * 24 * 7 # 7 days
|
||||||
"""Hold time (default in sec.), after which a value is removed from the cache."""
|
"""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
|
@dataclasses.dataclass
|
||||||
class ExpireCacheStats:
|
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]]]
|
cached_items: dict[str, list[tuple[str, typing.Any, int]]]
|
||||||
"""Values in the cache mapped by context name.
|
"""Values in the cache mapped by context name.
|
||||||
|
@ -79,7 +79,7 @@ class EngineCache:
|
|||||||
<searx.cache.ExpireCacheSQLite>`).
|
<searx.cache.ExpireCacheSQLite>`).
|
||||||
|
|
||||||
In the :origin:`searx/engines/demo_offline.py` engine you can find an
|
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:
|
in:
|
||||||
|
|
||||||
- :origin:`searx/engines/radio_browser.py`
|
- :origin:`searx/engines/radio_browser.py`
|
||||||
|
@ -156,7 +156,7 @@ def parse_image_item(item):
|
|||||||
def parse_video_item(item):
|
def parse_video_item(item):
|
||||||
|
|
||||||
# in video items, the title is more or less a "content description", we try
|
# 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"]
|
title = item["title"]
|
||||||
content = ""
|
content = ""
|
||||||
|
@ -77,7 +77,7 @@ def response(resp):
|
|||||||
elif item_type == 'video':
|
elif item_type == 'video':
|
||||||
results.append(_video(item))
|
results.append(_video(item))
|
||||||
else:
|
else:
|
||||||
logger.error("unknow result type: %s", item_type)
|
logger.error("unknown result type: %s", item_type)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class SXNG_Request(flask.Request):
|
|||||||
"""list of searx.plugins.Plugin.id (the id of the plugins)"""
|
"""list of searx.plugins.Plugin.id (the id of the plugins)"""
|
||||||
|
|
||||||
preferences: "searx.preferences.Preferences"
|
preferences: "searx.preferences.Preferences"
|
||||||
"""The prefernces of the request."""
|
"""The preferences of the request."""
|
||||||
|
|
||||||
errors: list[str]
|
errors: list[str]
|
||||||
"""A list of errors (translated text) added by :py:obj:`searx.webapp` in
|
"""A list of errors (translated text) added by :py:obj:`searx.webapp` in
|
||||||
|
@ -140,7 +140,7 @@ class FaviconCacheConfig(msgspec.Struct): # pylint: disable=too-few-public-meth
|
|||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class FaviconCacheStats:
|
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
|
favicons: int | None = None
|
||||||
bytes: 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!
|
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
|
# 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:
|
with self.connect() as conn:
|
||||||
|
|
||||||
|
@ -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 type_hint parameter must be one of 'counter', 'gauge', 'histogram', 'summary'.
|
||||||
The help_hint parameter is a short string explaining the metric.
|
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_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.
|
See https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md for more information.
|
||||||
"""
|
"""
|
||||||
|
@ -26,7 +26,7 @@ log: logging.Logger = logging.getLogger("searx.plugins")
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class PluginInfo:
|
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.
|
the user in the Preferences menu.
|
||||||
|
|
||||||
To be able to translate the information into other languages, the text must
|
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)."""
|
constructor (if not already set in the subclass)."""
|
||||||
|
|
||||||
info: PluginInfo
|
info: PluginInfo
|
||||||
"""Informations about the *plugin*, see :py:obj:`PluginInfo`."""
|
"""Information about the *plugin*, see :py:obj:`PluginInfo`."""
|
||||||
|
|
||||||
fqn: str = ""
|
fqn: str = ""
|
||||||
|
|
||||||
@ -129,8 +129,8 @@ class Plugin(abc.ABC):
|
|||||||
def init(self, app: "flask.Flask") -> bool: # pylint: disable=unused-argument
|
def init(self, app: "flask.Flask") -> bool: # pylint: disable=unused-argument
|
||||||
"""Initialization of the plugin, the return value decides whether this
|
"""Initialization of the plugin, the return value decides whether this
|
||||||
plugin is active or not. Initialization only takes place once, at the
|
plugin is active or not. Initialization only takes place once, at the
|
||||||
time the WEB application is set up. The base methode always returns
|
time the WEB application is set up. The base method always returns
|
||||||
``True``, the methode can be overwritten in the inheritances,
|
``True``, the method can be overwritten in the inheritances,
|
||||||
|
|
||||||
- ``True`` plugin is active
|
- ``True`` plugin is active
|
||||||
- ``False`` plugin is inactive
|
- ``False`` plugin is inactive
|
||||||
|
@ -114,7 +114,7 @@ class SQLiteAppl(abc.ABC):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
SQLITE_JOURNAL_MODE = "WAL"
|
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`).
|
to change the journal mode (see :py:obj:`SQLiteAppl.tear_down`).
|
||||||
|
|
||||||
.. _WAL: https://sqlite.org/wal.html
|
.. _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/118172
|
||||||
- https://github.com/python/cpython/issues/123873
|
- 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.
|
option ``cached_statements`` to ``0`` by default.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -1276,7 +1276,7 @@ uWSGI_distro_setup() {
|
|||||||
# Fedora runs uWSGI in emperor-tyrant mode: in Tyrant mode the
|
# Fedora runs uWSGI in emperor-tyrant mode: in Tyrant mode the
|
||||||
# Emperor will run the vassal using the UID/GID of the vassal
|
# Emperor will run the vassal using the UID/GID of the vassal
|
||||||
# configuration file [1] (user and group of the app .ini file).
|
# 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
|
# 2.0.x, read at least: https://github.com/unbit/uwsgi/issues/2099
|
||||||
uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available"
|
uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available"
|
||||||
uWSGI_APPS_ENABLED="${uWSGI_SETUP}.d"
|
uWSGI_APPS_ENABLED="${uWSGI_SETUP}.d"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user