.oO SearXNG Developer Documentation Oo.
|
Functions | |
_eval_expr (expr) | |
_eval (node) | |
handler (multiprocessing.Queue q, func, args, **kwargs) | |
timeout_func (timeout, func, *args, **kwargs) | |
EngineResults | post_search (request, search) |
Variables | |
str | name = "Basic Calculator" |
description = gettext("Calculate mathematical expressions via the search bar") | |
bool | default_on = True |
str | preference_section = 'general' |
str | plugin_id = 'calculator' |
dict | operators |
mp_fork = multiprocessing.get_context("fork") | |
Calculate mathematical expressions using :py:obj`ast.parse` (mode="eval").
|
protected |
Definition at line 58 of file calculator.py.
References _eval().
Referenced by _eval(), and _eval_expr().
|
protected |
>>> _eval_expr('2^6') 64 >>> _eval_expr('2**6') 64 >>> _eval_expr('1 + 2*3**(4^5) / (6 + -7)') -5.0
Definition at line 42 of file calculator.py.
References _eval().
searx.plugins.calculator.handler | ( | multiprocessing.Queue | q, |
func, | |||
args, | |||
** | kwargs ) |
Definition at line 71 of file calculator.py.
EngineResults searx.plugins.calculator.post_search | ( | request, | |
search ) |
Definition at line 97 of file calculator.py.
References timeout_func().
searx.plugins.calculator.timeout_func | ( | timeout, | |
func, | |||
* | args, | ||
** | kwargs ) |
Definition at line 79 of file calculator.py.
Referenced by post_search().
bool searx.plugins.calculator.default_on = True |
Definition at line 21 of file calculator.py.
searx.plugins.calculator.description = gettext("Calculate mathematical expressions via the search bar") |
Definition at line 20 of file calculator.py.
searx.plugins.calculator.mp_fork = multiprocessing.get_context("fork") |
Definition at line 39 of file calculator.py.
str searx.plugins.calculator.name = "Basic Calculator" |
Definition at line 19 of file calculator.py.
dict searx.plugins.calculator.operators |
Definition at line 25 of file calculator.py.
str searx.plugins.calculator.plugin_id = 'calculator' |
Definition at line 23 of file calculator.py.
str searx.plugins.calculator.preference_section = 'general' |
Definition at line 22 of file calculator.py.