summaryrefslogtreecommitdiff
path: root/searx/answerers
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-12-27 09:26:22 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-12-27 09:26:22 +0100
commit3d96a9839a12649874b6d4cf9466bd3616b0a03c (patch)
treee7d54d1e345b1e792d538ddc250f4827bb2fd9b9 /searx/answerers
parentfcdc2c2cd26e24c2aa3f064d93cee3e29dc2a30c (diff)
[format.python] initial formatting of the python code
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/answerers')
-rw-r--r--searx/answerers/random/answerer.py25
-rw-r--r--searx/answerers/statistics/answerer.py14
2 files changed, 20 insertions, 19 deletions
diff --git a/searx/answerers/random/answerer.py b/searx/answerers/random/answerer.py
index d5223e517..e6c383330 100644
--- a/searx/answerers/random/answerer.py
+++ b/searx/answerers/random/answerer.py
@@ -8,13 +8,12 @@ from flask_babel import gettext
# specifies which search query keywords triggers this answerer
keywords = ('random',)
-random_int_max = 2**31
+random_int_max = 2 ** 31
random_string_letters = string.ascii_lowercase + string.digits + string.ascii_uppercase
def random_characters():
- return [random.choice(random_string_letters)
- for _ in range(random.randint(8, 32))]
+ return [random.choice(random_string_letters) for _ in range(random.randint(8, 32))]
def random_string():
@@ -39,11 +38,13 @@ def random_uuid():
return str(uuid.uuid4())
-random_types = {'string': random_string,
- 'int': random_int,
- 'float': random_float,
- 'sha256': random_sha256,
- 'uuid': random_uuid}
+random_types = {
+ 'string': random_string,
+ 'int': random_int,
+ 'float': random_float,
+ 'sha256': random_sha256,
+ 'uuid': random_uuid,
+}
# required answerer function
@@ -62,6 +63,8 @@ def answer(query):
# required answerer function
# returns information about the answerer
def self_info():
- return {'name': gettext('Random value generator'),
- 'description': gettext('Generate different random values'),
- 'examples': ['random {}'.format(x) for x in random_types]}
+ return {
+ 'name': gettext('Random value generator'),
+ 'description': gettext('Generate different random values'),
+ 'examples': ['random {}'.format(x) for x in random_types],
+ }
diff --git a/searx/answerers/statistics/answerer.py b/searx/answerers/statistics/answerer.py
index abd4be7f5..60f0d304f 100644
--- a/searx/answerers/statistics/answerer.py
+++ b/searx/answerers/statistics/answerer.py
@@ -4,11 +4,7 @@ from operator import mul
from flask_babel import gettext
-keywords = ('min',
- 'max',
- 'avg',
- 'sum',
- 'prod')
+keywords = ('min', 'max', 'avg', 'sum', 'prod')
# required answerer function
@@ -47,6 +43,8 @@ def answer(query):
# required answerer function
# returns information about the answerer
def self_info():
- return {'name': gettext('Statistics functions'),
- 'description': gettext('Compute {functions} of the arguments').format(functions='/'.join(keywords)),
- 'examples': ['avg 123 548 2.04 24.2']}
+ return {
+ 'name': gettext('Statistics functions'),
+ 'description': gettext('Compute {functions} of the arguments').format(functions='/'.join(keywords)),
+ 'examples': ['avg 123 548 2.04 24.2'],
+ }