Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52eba0c7 authored by Adam Tauber's avatar Adam Tauber
Browse files

[fix] pep8

parent 9f5cd28d
Loading
Loading
Loading
Loading
+21 −16
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ suggestion_xpath = '//div[contains(@class, "card-section")]//a'
# *spelling suggestions*, we use them anyway.
spelling_suggestion_xpath = '//div[@class="med"]/p/a'


def extract_text_from_dom(result, xpath):
    """returns extract_text on the first result selected by the xpath or None"""
    r = eval_xpath(result, xpath)
@@ -138,6 +139,7 @@ def extract_text_from_dom(result, xpath):
        return extract_text(r[0])
    return None


def get_lang_country(params, lang_list, custom_aliases):
    """Returns a tuple with *langauage* on its first and *country* on its second
    position."""
@@ -159,6 +161,7 @@ def get_lang_country(params, lang_list, custom_aliases):

    return language, country, lang_country


def request(query, params):
    """Google search request"""

@@ -200,6 +203,7 @@ def request(query, params):

    return params


def response(resp):
    """Get response from google's search request"""
    results = []
@@ -272,6 +276,7 @@ def response(resp):
    # return results
    return results


# get supported languages from their site
def _fetch_supported_languages(resp):
    ret_val = {}
+22 −20
Original line number Diff line number Diff line
@@ -33,15 +33,15 @@ from searx.engines.xpath import extract_text

# pylint: disable=unused-import
from searx.engines.google import (
    supported_languages_url
    ,  _fetch_supported_languages
    supported_languages_url,
    _fetch_supported_languages,
)
# pylint: enable=unused-import

from searx.engines.google import (
    get_lang_country
    , google_domains
    , time_range_dict
    get_lang_country,
    google_domains,
    time_range_dict,
)

logger = logger.getChild('google images')
@@ -61,6 +61,7 @@ filter_mapping = {
    2: 'active'
}


def scrap_out_thumbs(dom):
    """Scrap out thumbnail data from <script> tags.
    """
@@ -75,6 +76,7 @@ def scrap_out_thumbs(dom):
        ret_val[_thumb_no] = _img_data.replace(r"\x3d", "=")
    return ret_val


def request(query, params):
    """Google-Video search request"""