From 4fd918fca4ecf38ba63c020148450bdc825811e1 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Tue, 3 Nov 2015 00:44:47 +0100 Subject: [PATCH] Fixed some pylint violations. --- gitinspector/clone.py | 1 - gitinspector/output/changesoutput.py | 1 - gitinspector/output/responsibilitiesoutput.py | 15 +++++++-------- gitinspector/responsibilities.py | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/gitinspector/clone.py b/gitinspector/clone.py index a1cae4b..4fe858d 100644 --- a/gitinspector/clone.py +++ b/gitinspector/clone.py @@ -18,7 +18,6 @@ # along with gitinspector. If not, see . from __future__ import unicode_literals -from collections import namedtuple import os import shutil import subprocess diff --git a/gitinspector/output/changesoutput.py b/gitinspector/output/changesoutput.py index 4e3b380..b42417d 100644 --- a/gitinspector/output/changesoutput.py +++ b/gitinspector/output/changesoutput.py @@ -20,7 +20,6 @@ from __future__ import print_function from __future__ import unicode_literals import json -import sys import textwrap from ..localization import N_ from .. import format, gravatar, terminal diff --git a/gitinspector/output/responsibilitiesoutput.py b/gitinspector/output/responsibilitiesoutput.py index 27c4d62..d70ba4d 100644 --- a/gitinspector/output/responsibilitiesoutput.py +++ b/gitinspector/output/responsibilitiesoutput.py @@ -40,8 +40,8 @@ class ResponsibilitiesOutput(Outputable): print("\n" + textwrap.fill(_(RESPONSIBILITIES_INFO_TEXT) + ":", width=terminal.get_size()[0])) for i in sorted(set(i[0] for i in self.blame.blames)): - responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.changes, - self.blame, i)), reverse=True) + responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.blame, i)), reverse=True) + if responsibilities: print("\n" + i, _(MOSTLY_RESPONSIBLE_FOR_TEXT) + ":") @@ -60,8 +60,8 @@ class ResponsibilitiesOutput(Outputable): resp_xml += "

" + _(RESPONSIBILITIES_INFO_TEXT) + ".

" for i in sorted(set(i[0] for i in self.blame.blames)): - responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.changes, - self.blame, i)), reverse=True) + responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.blame, i)), reverse=True) + if responsibilities: resp_xml += "
" @@ -87,8 +87,8 @@ class ResponsibilitiesOutput(Outputable): resp_xml = "" for i in sorted(set(i[0] for i in self.blame.blames)): - responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.changes, - self.blame, i)), reverse=True) + responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.blame, i)), reverse=True) + if responsibilities: author_email = self.changes.get_latest_email_by_author(i) @@ -118,8 +118,7 @@ class ResponsibilitiesOutput(Outputable): resp_xml = "" for i in sorted(set(i[0] for i in self.blame.blames)): - responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.changes, - self.blame, i)), reverse=True) + responsibilities = sorted(((i[1], i[0]) for i in resp.Responsibilities.get(self.blame, i)), reverse=True) if responsibilities: author_email = self.changes.get_latest_email_by_author(i) diff --git a/gitinspector/responsibilities.py b/gitinspector/responsibilities.py index 5868dae..7e2259a 100644 --- a/gitinspector/responsibilities.py +++ b/gitinspector/responsibilities.py @@ -19,14 +19,13 @@ from __future__ import print_function from __future__ import unicode_literals -from . import blame class ResponsibiltyEntry(object): blames = {} class Responsibilities(object): @staticmethod - def get(changes, blame, author_name): + def get(blame, author_name): author_blames = {} for i in blame.blames.items():