Mercurial > kallithea
changeset 4424:fc7eed9ebe60
cleanup: various fixes, issues found with pyflakes
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 12 Aug 2014 13:08:23 +0200 |
parents | 395be5fa6eef |
children | a1841a3cf03b |
files | kallithea/controllers/journal.py kallithea/lib/celerylib/tasks.py kallithea/lib/dbmigrate/migrate/versioning/repository.py kallithea/lib/helpers.py kallithea/lib/paster_commands/make_index.py |
diffstat | 5 files changed, 15 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/journal.py Tue Aug 12 13:08:23 2014 +0200 +++ b/kallithea/controllers/journal.py Tue Aug 12 13:08:23 2014 +0200 @@ -67,7 +67,7 @@ for k, g in groupby(journal, lambda x: x.action_as_day): user_group = [] #groupby username if it's a present value, else fallback to journal username - for _, g2 in groupby(list(g), lambda x: x.user.username if x.user else x.username): + for _unused, g2 in groupby(list(g), lambda x: x.user.username if x.user else x.username): l = list(g2) user_group.append((l[0].user, l))
--- a/kallithea/lib/celerylib/tasks.py Tue Aug 12 13:08:23 2014 +0200 +++ b/kallithea/lib/celerylib/tasks.py Tue Aug 12 13:08:23 2014 +0200 @@ -53,8 +53,7 @@ add_cache(config) # pragma: no cover -__all__ = ['whoosh_index', 'get_commits_stats', - 'reset_user_password', 'send_email'] +__all__ = ['whoosh_index', 'get_commits_stats', 'send_email'] def get_logger(cls):
--- a/kallithea/lib/dbmigrate/migrate/versioning/repository.py Tue Aug 12 13:08:23 2014 +0200 +++ b/kallithea/lib/dbmigrate/migrate/versioning/repository.py Tue Aug 12 13:08:23 2014 +0200 @@ -63,7 +63,7 @@ def run(self, *p, **k): """Run the changeset scripts""" - for version, script in self: + for _version, script in self: script.run(*p, **k)
--- a/kallithea/lib/helpers.py Tue Aug 12 13:08:23 2014 +0200 +++ b/kallithea/lib/helpers.py Tue Aug 12 13:08:23 2014 +0200 @@ -328,7 +328,7 @@ golden_ratio = 0.618033988749895 h = 0.22717784590367374 - for _ in xrange(n): + for _unused in xrange(n): h += golden_ratio h %= 1 HSV_tuple = [h, 0.95, 0.95] @@ -684,8 +684,7 @@ # just display it, takes less space than displaying # "and 1 more revisions" if len(revs_ids) == revs_limit + 1: - rev = revs[revs_limit] - cs_links.append(", " + lnk(rev, repo_name)) + cs_links.append(", " + lnk(revs[revs_limit], repo_name)) # hidden-by-default ones if len(revs_ids) > revs_limit + 1: @@ -1329,25 +1328,24 @@ pref = ' ' issue_id = ''.join(match_obj.groups()) - tmpl = ( - '%(pref)s<a class="%(cls)s" href="%(url)s">' - '%(issue-prefix)s%(id-repr)s' - '</a>' - ) - url = ISSUE_SERVER_LNK.replace('{id}', issue_id) + issue_url = ISSUE_SERVER_LNK.replace('{id}', issue_id) if repository: - url = url.replace('{repo}', repository) + issue_url = issue_url.replace('{repo}', repository) repo_name = repository.split(URL_SEP)[-1] - url = url.replace('{repo_name}', repo_name) + issue_url = issue_url.replace('{repo_name}', repo_name) - return tmpl % { + return ( + '%(pref)s<a class="%(cls)s" href="%(url)s">' + '%(issue-prefix)s%(id-repr)s' + '</a>' + ) % { 'pref': pref, 'cls': 'issue-tracker-link', - 'url': url, + 'url': issue_url, 'id-repr': issue_id, 'issue-prefix': ISSUE_PREFIX, 'serv': ISSUE_SERVER_LNK, - } + } newtext = URL_PAT.sub(url_func, newtext) log.debug('processed prefix:`%s` => %s' % (pattern_index, newtext))
--- a/kallithea/lib/paster_commands/make_index.py Tue Aug 12 13:08:23 2014 +0200 +++ b/kallithea/lib/paster_commands/make_index.py Tue Aug 12 13:08:23 2014 +0200 @@ -32,7 +32,6 @@ import sys import logging -from kallithea.lib.utils import BasePasterCommand from string import strip from kallithea.model.repo import RepoModel from kallithea.lib.utils import BasePasterCommand, load_rcextensions