mirror of
https://github.com/searxng/searxng.git
synced 2025-07-13 00:09:18 +02:00
[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>
This commit is contained in:
parent
fcdc2c2cd2
commit
3d96a9839a
184 changed files with 2800 additions and 2836 deletions
|
@ -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],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue