mirror of
https://github.com/searx/searx
synced 2025-02-21 22:27:41 +01:00
little update update comments in search.py
This commit is contained in:
parent
bc30c4f4ad
commit
22da73b8bb
@ -251,7 +251,7 @@ class Search(object):
|
|||||||
if query_parts[0].startswith(':'):
|
if query_parts[0].startswith(':'):
|
||||||
lang = query_parts[0][1:].lower()
|
lang = query_parts[0][1:].lower()
|
||||||
|
|
||||||
# check if any language-code equal with declared language-codes
|
# check if any language-code is equal with declared language-codes
|
||||||
for lc in language_codes:
|
for lc in language_codes:
|
||||||
lang_id, lang_name, country = map(str.lower, lc)
|
lang_id, lang_name, country = map(str.lower, lc)
|
||||||
|
|
||||||
@ -268,21 +268,21 @@ class Search(object):
|
|||||||
elif query_parts[0].startswith('!'):
|
elif query_parts[0].startswith('!'):
|
||||||
prefix = query_parts[0][1:].replace('_', ' ')
|
prefix = query_parts[0][1:].replace('_', ' ')
|
||||||
|
|
||||||
# check if prefix equal with engine shortcut
|
# check if prefix is equal with engine shortcut
|
||||||
if prefix in engine_shortcuts\
|
if prefix in engine_shortcuts\
|
||||||
and not engine_shortcuts[prefix] in self.blocked_engines:
|
and not engine_shortcuts[prefix] in self.blocked_engines:
|
||||||
modified = True
|
modified = True
|
||||||
self.engines.append({'category': 'none',
|
self.engines.append({'category': 'none',
|
||||||
'name': engine_shortcuts[prefix]})
|
'name': engine_shortcuts[prefix]})
|
||||||
|
|
||||||
# check if prefix equal with engine name
|
# check if prefix is equal with engine name
|
||||||
elif prefix in engines\
|
elif prefix in engines\
|
||||||
and not prefix in self.blocked_engines:
|
and not prefix in self.blocked_engines:
|
||||||
modified = True
|
modified = True
|
||||||
self.engines.append({'category': 'none',
|
self.engines.append({'category': 'none',
|
||||||
'name': prefix})
|
'name': prefix})
|
||||||
|
|
||||||
# check if prefix equal with categorie name
|
# check if prefix is equal with categorie name
|
||||||
elif prefix in categories:
|
elif prefix in categories:
|
||||||
modified = True
|
modified = True
|
||||||
# using all engines for that search, which are declared under that categorie name
|
# using all engines for that search, which are declared under that categorie name
|
||||||
@ -305,7 +305,7 @@ class Search(object):
|
|||||||
results = {}
|
results = {}
|
||||||
suggestions = set()
|
suggestions = set()
|
||||||
|
|
||||||
# increase number of active searches
|
# increase number of searches
|
||||||
number_of_searches += 1
|
number_of_searches += 1
|
||||||
|
|
||||||
# set default useragent
|
# set default useragent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user