Files

29 lines
724 B
Python
Raw Permalink Normal View History

2024-04-07 15:52:00 +02:00
# SPDX-License-Identifier: AGPL-3.0-or-later
2025-12-02 10:18:00 +00:00
# pylint: disable=missing-module-docstring
2024-04-07 15:52:00 +02:00
2025-12-02 10:18:00 +00:00
import typing as t
2025-12-02 10:18:00 +00:00
from flask_babel import gettext # pyright: ignore[reportUnknownVariableType]
2024-04-07 15:52:00 +02:00
from searx.plugins import Plugin, PluginInfo
2025-12-02 10:18:00 +00:00
if t.TYPE_CHECKING:
from searx.plugins import PluginCfg
2024-04-07 15:52:00 +02:00
2025-12-02 10:18:00 +00:00
@t.final
class SXNGPlugin(Plugin):
2025-12-02 10:18:00 +00:00
"""Parses and solves mathematical expressions."""
id = "calculator"
def __init__(self, plg_cfg: "PluginCfg") -> None:
super().__init__(plg_cfg)
self.info = PluginInfo(
id=self.id,
2025-12-02 10:18:00 +00:00
name=gettext("Calculator"),
description=gettext("Parses and solves mathematical expressions."),
preference_section="query",
)