diff --git a/kallithea/controllers/journal.py b/kallithea/controllers/journal.py
--- a/kallithea/controllers/journal.py
+++ b/kallithea/controllers/journal.py
@@ -67,7 +67,7 @@ class JournalController(BaseController):
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))
diff --git a/kallithea/lib/celerylib/tasks.py b/kallithea/lib/celerylib/tasks.py
--- a/kallithea/lib/celerylib/tasks.py
+++ b/kallithea/lib/celerylib/tasks.py
@@ -53,8 +53,7 @@ from kallithea.model.db import Statistic
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):
diff --git a/kallithea/lib/dbmigrate/migrate/versioning/repository.py b/kallithea/lib/dbmigrate/migrate/versioning/repository.py
--- a/kallithea/lib/dbmigrate/migrate/versioning/repository.py
+++ b/kallithea/lib/dbmigrate/migrate/versioning/repository.py
@@ -63,7 +63,7 @@ class Changeset(dict):
def run(self, *p, **k):
"""Run the changeset scripts"""
- for version, script in self:
+ for _version, script in self:
script.run(*p, **k)
diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py
--- a/kallithea/lib/helpers.py
+++ b/kallithea/lib/helpers.py
@@ -328,7 +328,7 @@ def pygmentize_annotation(repo_name, fil
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 @@ def action_parser(user_log, feed=False,
# 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 @@ def urlify_commit(text_, repository, lin
pref = ' '
issue_id = ''.join(match_obj.groups())
- tmpl = (
- '%(pref)s'
- '%(issue-prefix)s%(id-repr)s'
- ''
- )
- 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'
+ '%(issue-prefix)s%(id-repr)s'
+ ''
+ ) % {
'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))
diff --git a/kallithea/lib/paster_commands/make_index.py b/kallithea/lib/paster_commands/make_index.py
--- a/kallithea/lib/paster_commands/make_index.py
+++ b/kallithea/lib/paster_commands/make_index.py
@@ -32,7 +32,6 @@ import os
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