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

Commit cc26dde7 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Update pep8 tools to pycodestyle

pep8 is deprecated, it is replaced by pycodestyle.
parent bbb5e68b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -35,7 +35,8 @@ pep8_check() {
    # ignored rules:
    # ignored rules:
    #  E402 module level import not at top of file
    #  E402 module level import not at top of file
    #  W503 line break before binary operator
    #  W503 line break before binary operator
    pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" "$SEARX_DIR" "$BASE_DIR/tests"
    #  E722 do not use bare 'except'
    pycodestyle --exclude=searx/static --max-line-length=120 --ignore "E402,W503,E722" "$SEARX_DIR" "$BASE_DIR/tests"
}
}


unit_tests() {
unit_tests() {
+1 −1
Original line number Original line Diff line number Diff line
babel==2.3.4
babel==2.3.4
mock==2.0.0
mock==2.0.0
pep8==1.7.0
pycodestyle==2.4.0
mockredispy==2.9.3
mockredispy==2.9.3
pytest==4.1.0
pytest==4.1.0
pytest-cov==2.6.1
pytest-cov==2.6.1
+2 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ from io import open
from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
try:
try:
    from yaml import load
    from yaml import load
except:
except ImportError:
    from sys import exit, stderr
    from sys import exit, stderr
    stderr.write('[E] install pyyaml\n')
    stderr.write('[E] install pyyaml\n')
    exit(2)
    exit(2)
@@ -38,6 +38,7 @@ def check_settings_yml(file_name):
    else:
    else:
        return None
        return None



# find location of settings.yml
# find location of settings.yml
if 'SEARX_SETTINGS_PATH' in environ:
if 'SEARX_SETTINGS_PATH' in environ:
    # if possible set path to settings using the
    # if possible set path to settings using the
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ def _fetch_supported_languages(resp):


    regions = dom.xpath(regions_xpath)
    regions = dom.xpath(regions_xpath)
    for region in regions:
    for region in regions:
        code = re.search('setmkt=[^\&]+', region).group()[7:]
        code = re.search('setmkt=[^&]+', region).group()[7:]
        if code == 'nb-NO':
        if code == 'nb-NO':
            code = 'no-NO'
            code = 'no-NO'


+1 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,7 @@ def parse_album(hit):
            result.update({'content': 'Released: {}'.format(year)})
            result.update({'content': 'Released: {}'.format(year)})
    return result
    return result



parse = {'lyric': parse_lyric, 'song': parse_lyric, 'artist': parse_artist, 'album': parse_album}
parse = {'lyric': parse_lyric, 'song': parse_lyric, 'artist': parse_artist, 'album': parse_album}




Loading