Restore relative imports of changes and filtering

This commit is contained in:
Marc Harper 2015-10-20 09:48:32 -07:00
parent 9abb9b3d56
commit 4f3e0d3073
3 changed files with 21 additions and 21 deletions

View file

@ -26,7 +26,7 @@ import subprocess
import sys
import threading
from . import changes
from .changes import FileDiff
from . import comment
from . import filtering
from . import format
@ -140,11 +140,11 @@ class Blame(object):
row = row.encode("latin-1", "replace")
row = row.decode("utf-8", "replace").strip("\"").strip("'").strip()
if changes.FileDiff.is_valid_extension(row) and not filtering.set_filtered(changes.FileDiff.get_filename(row)):
if FileDiff.is_valid_extension(row) and not filtering.set_filtered(FileDiff.get_filename(row)):
blame_command = filter(None, ["git", "blame", "--line-porcelain", "-w"] + \
(["-C", "-C", "-M"] if hard else []) +
[interval.get_since(), interval.get_ref(), "--", row])
thread = BlameThread(useweeks, changes, blame_command, changes.FileDiff.get_extension(row), self.blames, row.strip())
thread = BlameThread(useweeks, changes, blame_command, FileDiff.get_extension(row), self.blames, row.strip())
thread.daemon = True
thread.start()

View file

@ -22,7 +22,7 @@ from __future__ import unicode_literals
import re
import subprocess
from . import changes
from .changes import FileDiff
from . import comment
from . import filtering
from . import interval
@ -56,11 +56,11 @@ class MetricsLogic(object):
i = i.encode("latin-1", "replace")
i = i.decode("utf-8", "replace").strip("\"").strip("'").strip()
if changes.FileDiff.is_valid_extension(i) and not filtering.set_filtered(changes.FileDiff.get_filename(i)):
if FileDiff.is_valid_extension(i) and not filtering.set_filtered(FileDiff.get_filename(i)):
file_r = subprocess.Popen(["git", "show", interval.get_ref() + ":{0}".format(i.strip())],
bufsize=1, stdout=subprocess.PIPE).stdout.readlines()
extension = changes.FileDiff.get_extension(i)
extension = FileDiff.get_extension(i)
lines = MetricsLogic.get_eloc(file_r, extension)
cycc = MetricsLogic.get_cyclomatic_complexity(file_r, extension)

View file

@ -21,7 +21,7 @@ from __future__ import print_function
from __future__ import unicode_literals
import textwrap
from .. import filtering
from ..filtering import __filters__, has_filtered
from ..localization import N_
from .. import terminal
from .outputable import Outputable
@ -48,12 +48,12 @@ class FilteringOutput(Outputable):
return filtering_xml
def output_html(self):
if filtering.has_filtered():
if has_filtered():
filtering_xml = "<div><div class=\"box\">"
FilteringOutput.__output_html_section__(_(FILTERING_INFO_TEXT), filtering.__filters__["file"][1])
FilteringOutput.__output_html_section__(_(FILTERING_AUTHOR_INFO_TEXT), filtering.__filters__["author"][1])
FilteringOutput.__output_html_section__(_(FILTERING_EMAIL_INFO_TEXT), filtering.__filters__["email"][1])
FilteringOutput.__output_html_section__(_(FILTERING_COMMIT_INFO_TEXT), filtering.__filters__["revision"][1])
FilteringOutput.__output_html_section__(_(FILTERING_INFO_TEXT), __filters__["file"][1])
FilteringOutput.__output_html_section__(_(FILTERING_AUTHOR_INFO_TEXT), __filters__["author"][1])
FilteringOutput.__output_html_section__(_(FILTERING_EMAIL_INFO_TEXT), __filters__["email"][1])
FilteringOutput.__output_html_section__(_(FILTERING_COMMIT_INFO_TEXT), __filters__["revision"][1])
filtering_xml += "</div></div>"
print(filtering_xml)
@ -68,10 +68,10 @@ class FilteringOutput(Outputable):
print("...%s" % i[-width+3:] if len(i) > width else i)
def output_text(self):
FilteringOutput.__output_text_section__(_(FILTERING_INFO_TEXT), filtering.__filters__["file"][1])
FilteringOutput.__output_text_section__(_(FILTERING_AUTHOR_INFO_TEXT), filtering.__filters__["author"][1])
FilteringOutput.__output_text_section__(_(FILTERING_EMAIL_INFO_TEXT), filtering.__filters__["email"][1])
FilteringOutput.__output_text_section__(_(FILTERING_COMMIT_INFO_TEXT), filtering.__filters__["revision"][1])
FilteringOutput.__output_text_section__(_(FILTERING_INFO_TEXT), __filters__["file"][1])
FilteringOutput.__output_text_section__(_(FILTERING_AUTHOR_INFO_TEXT), __filters__["author"][1])
FilteringOutput.__output_text_section__(_(FILTERING_EMAIL_INFO_TEXT), __filters__["email"][1])
FilteringOutput.__output_text_section__(_(FILTERING_COMMIT_INFO_TEXT), __filters__["revision"][1])
@staticmethod
def __output_xml_section__(info_string, filtered, container_tagname):
@ -87,10 +87,10 @@ class FilteringOutput(Outputable):
print("\t\t</{0}>".format(container_tagname))
def output_xml(self):
if filtering.has_filtered():
if has_filtered():
print("\t<filtering>")
FilteringOutput.__output_xml_section__(_(FILTERING_INFO_TEXT), filtering.__filters__["file"][1], "files")
FilteringOutput.__output_xml_section__(_(FILTERING_AUTHOR_INFO_TEXT), filtering.__filters__["author"][1], "authors")
FilteringOutput.__output_xml_section__(_(FILTERING_EMAIL_INFO_TEXT), filtering.__filters__["email"][1], "emails")
FilteringOutput.__output_xml_section__(_(FILTERING_COMMIT_INFO_TEXT), filtering.__filters__["revision"][1], "revision")
FilteringOutput.__output_xml_section__(_(FILTERING_INFO_TEXT), __filters__["file"][1], "files")
FilteringOutput.__output_xml_section__(_(FILTERING_AUTHOR_INFO_TEXT), __filters__["author"][1], "authors")
FilteringOutput.__output_xml_section__(_(FILTERING_EMAIL_INFO_TEXT), __filters__["email"][1], "emails")
FilteringOutput.__output_xml_section__(_(FILTERING_COMMIT_INFO_TEXT), __filters__["revision"][1], "revision")
print("\t</filtering>")