diff options
author | Alexandre Flament <alex@al-f.net> | 2020-11-16 09:43:23 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-12-01 15:21:19 +0100 |
commit | b00d108673082fc2487b2d122db00d988f561427 (patch) | |
tree | 51b5324935f24864730d705efd9f4f6a9dea465f /searx/query.py | |
parent | 9ed3ee2bebf2f159d4231d9aad9df53aea6db90a (diff) | |
download | searxng-b00d108673082fc2487b2d122db00d988f561427.tar.gz searxng-b00d108673082fc2487b2d122db00d988f561427.zip |
[mod] pylint: numerous minor code fixes
Diffstat (limited to 'searx/query.py')
-rw-r--r-- | searx/query.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/searx/query.py b/searx/query.py index 7effda15a..422cd57b5 100644 --- a/searx/query.py +++ b/searx/query.py @@ -92,15 +92,15 @@ class RawTextQuery: or lang == english_name or lang.replace('-', ' ') == country)\ and lang not in self.languages: - searx_query_part = True - lang_parts = lang_id.split('-') - if len(lang_parts) == 2: - self.languages.append(lang_parts[0] + '-' + lang_parts[1].upper()) - else: - self.languages.append(lang_id) - # to ensure best match (first match is not necessarily the best one) - if lang == lang_id: - break + searx_query_part = True + lang_parts = lang_id.split('-') + if len(lang_parts) == 2: + self.languages.append(lang_parts[0] + '-' + lang_parts[1].upper()) + else: + self.languages.append(lang_id) + # to ensure best match (first match is not necessarily the best one) + if lang == lang_id: + break # user may set a valid, yet not selectable language if VALID_LANGUAGE_CODE.match(lang): |