mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 08:38:26 +01:00
Fixed some pylint violations. This also takes care of some bugs.
This commit is contained in:
parent
dd2feedbe4
commit
9287b187f7
4 changed files with 2 additions and 5 deletions
|
@ -23,7 +23,6 @@ import datetime
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
import threading
|
import threading
|
||||||
from .localization import N_
|
from .localization import N_
|
||||||
from .changes import FileDiff
|
from .changes import FileDiff
|
||||||
|
|
|
@ -28,8 +28,6 @@ __cloned_paths__ = []
|
||||||
def create(url):
|
def create(url):
|
||||||
if url.startswith("file://") or url.startswith("git://") or url.startswith("http://") or \
|
if url.startswith("file://") or url.startswith("git://") or url.startswith("http://") or \
|
||||||
url.startswith("https://") or url.startswith("ssh://"):
|
url.startswith("https://") or url.startswith("ssh://"):
|
||||||
global __cloned_paths__
|
|
||||||
|
|
||||||
location = tempfile.mkdtemp(suffix=".gitinspector")
|
location = tempfile.mkdtemp(suffix=".gitinspector")
|
||||||
git_clone = subprocess.Popen(["git", "clone", url, location], bufsize=1, stdout=sys.stderr)
|
git_clone = subprocess.Popen(["git", "clone", url, location], bufsize=1, stdout=sys.stderr)
|
||||||
git_clone.wait()
|
git_clone.wait()
|
||||||
|
|
|
@ -21,6 +21,7 @@ from __future__ import print_function
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from ..localization import N_
|
from ..localization import N_
|
||||||
from .. import metrics
|
from .. import metrics
|
||||||
|
from .changes import FileDiff
|
||||||
from .outputable import Outputable
|
from .outputable import Outputable
|
||||||
|
|
||||||
ELOC_INFO_TEXT = N_("The following files are suspiciously big (in order of severity)")
|
ELOC_INFO_TEXT = N_("The following files are suspiciously big (in order of severity)")
|
||||||
|
@ -68,7 +69,7 @@ class MetricsOutput(Outputable):
|
||||||
if metrics_logic.eloc:
|
if metrics_logic.eloc:
|
||||||
metrics_xml += "<div><h4>" + _(ELOC_INFO_TEXT) + ".</h4>"
|
metrics_xml += "<div><h4>" + _(ELOC_INFO_TEXT) + ".</h4>"
|
||||||
for num, i in enumerate(sorted(set([(j, i) for (i, j) in metrics_logic.eloc.items()]), reverse=True)):
|
for num, i in enumerate(sorted(set([(j, i) for (i, j) in metrics_logic.eloc.items()]), reverse=True)):
|
||||||
metrics_xml += "<div class=\"" + __get_metrics_score__(__metric_eloc__[FileDiff.get_extension(i[1])], i[0]) + \
|
metrics_xml += "<div class=\"" + __get_metrics_score__(metrics.__metric_eloc__[FileDiff.get_extension(i[1])], i[0]) + \
|
||||||
(" odd\">" if num % 2 == 1 else "\">") + \
|
(" odd\">" if num % 2 == 1 else "\">") + \
|
||||||
_("{0} ({1} estimated lines of code)").format(i[1], str(i[0])) + "</div>"
|
_("{0} ({1} estimated lines of code)").format(i[1], str(i[0])) + "</div>"
|
||||||
metrics_xml += "</div>"
|
metrics_xml += "</div>"
|
||||||
|
|
|
@ -32,7 +32,6 @@ class Outputable(object):
|
||||||
raise NotImplementedError(_("Text output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
raise NotImplementedError(_("Text output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
||||||
|
|
||||||
def output_xml(self):
|
def output_xml(self):
|
||||||
NotImplementedError
|
|
||||||
raise NotImplementedError(_("XML output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
raise NotImplementedError(_("XML output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
||||||
|
|
||||||
def output(outputable):
|
def output(outputable):
|
||||||
|
|
Loading…
Reference in a new issue