Changeset - bb1154b80789
[Not reviewed]
default
0 2 0
Mads Kiilerich - 6 years ago 2019-07-21 23:26:24
mads@kiilerich.com
Grafted from: 151e2ec7319d
refactor: use string methods instead of class functions and map

Python 3 has no lower or strip functions - only string methods.
2 files changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_index.py
Show inline comments
 
@@ -23,7 +23,6 @@ import click
 
import kallithea.bin.kallithea_cli_base as cli_base
 

	
 
import os
 
from string import strip
 
import sys
 

	
 
import kallithea
 
@@ -45,9 +44,9 @@ def index_create(repo_location, index_on
 

	
 
    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:
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -34,7 +34,6 @@ import rfc822
 
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 __get_codes_stats(repo_name):
 

	
 
    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
0 comments (0 inline, 0 general)