# HG changeset patch # User Mads Kiilerich # Date 1563744384 -7200 # Node ID bb1154b80789a3e696464211c2175e4057805df2 # Parent a7d7157eca8e4cb5b9a74c7e297fa0b1e41a7182 refactor: use string methods instead of class functions and map Python 3 has no lower or strip functions - only string methods. diff -r a7d7157eca8e -r bb1154b80789 kallithea/bin/kallithea_cli_index.py --- a/kallithea/bin/kallithea_cli_index.py Mon Jul 22 00:37:47 2019 +0200 +++ b/kallithea/bin/kallithea_cli_index.py Sun Jul 21 23:26:24 2019 +0200 @@ -23,7 +23,6 @@ import kallithea.bin.kallithea_cli_base as cli_base import os -from string import strip import sys import kallithea @@ -45,9 +44,9 @@ if not repo_location: repo_location = RepoModel().repos_path - repo_list = map(strip, index_only.split(',')) \ + repo_list = [x.strip() for x in index_only.split(',')] \ if index_only else None - repo_update_list = map(strip, update_only.split(',')) \ + repo_update_list = [x.strip() for x in update_only.split(',')] \ if update_only else None try: diff -r a7d7157eca8e -r bb1154b80789 kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py Mon Jul 22 00:37:47 2019 +0200 +++ b/kallithea/lib/celerylib/tasks.py Sun Jul 21 23:26:24 2019 +0200 @@ -34,7 +34,6 @@ from collections import OrderedDict from time import mktime from operator import itemgetter -from string import lower from tg import config @@ -491,7 +490,7 @@ def aggregate(cs): for f in cs[2]: - ext = lower(f.extension) + ext = f.extension.lower() if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary: if ext in code_stats: code_stats[ext] += 1