Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gitinspector/basedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_basedir_git(path=None):
previous_directory = os.getcwd()
os.chdir(path)

bare_command = subprocess.Popen(["git", "rev-parse", "--is-bare-repository"], bufsize=1,
bare_command = subprocess.Popen(["git", "rev-parse", "--is-bare-repository"],
stdout=subprocess.PIPE, stderr=open(os.devnull, "w"))

isbare = bare_command.stdout.readlines()
Expand All @@ -47,9 +47,9 @@ def get_basedir_git(path=None):
absolute_path = None

if isbare:
absolute_path = subprocess.Popen(["git", "rev-parse", "--git-dir"], bufsize=1, stdout=subprocess.PIPE).stdout
absolute_path = subprocess.Popen(["git", "rev-parse", "--git-dir"], stdout=subprocess.PIPE).stdout
else:
absolute_path = subprocess.Popen(["git", "rev-parse", "--show-toplevel"], bufsize=1,
absolute_path = subprocess.Popen(["git", "rev-parse", "--show-toplevel"],
stdout=subprocess.PIPE).stdout

absolute_path = absolute_path.readlines()
Expand Down
4 changes: 2 additions & 2 deletions gitinspector/blame.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __handle_blamechunk_content__(self, content):
__blame_lock__.release() # ...to here.

def run(self):
git_blame_r = subprocess.Popen(self.blame_command, bufsize=1, stdout=subprocess.PIPE).stdout
git_blame_r = subprocess.Popen(self.blame_command, stdout=subprocess.PIPE).stdout
rows = git_blame_r.readlines()
git_blame_r.close()

Expand Down Expand Up @@ -123,7 +123,7 @@ def run(self):
class Blame(object):
def __init__(self, repo, hard, useweeks, changes):
self.blames = {}
ls_tree_p = subprocess.Popen(["git", "ls-tree", "--name-only", "-r", interval.get_ref()], bufsize=1,
ls_tree_p = subprocess.Popen(["git", "ls-tree", "--name-only", "-r", interval.get_ref()],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
lines = ls_tree_p.communicate()[0].splitlines()
ls_tree_p.stdout.close()
Expand Down
4 changes: 2 additions & 2 deletions gitinspector/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run(self):
git_log_r = subprocess.Popen(filter(None, ["git", "log", "--reverse", "--pretty=%ct|%cd|%H|%aN|%aE",
"--stat=100000,8192", "--no-merges", "-w", interval.get_since(),
interval.get_until(), "--date=short"] + (["-C", "-C", "-M"] if self.hard else []) +
[self.first_hash + self.second_hash]), bufsize=1, stdout=subprocess.PIPE).stdout
[self.first_hash + self.second_hash]), stdout=subprocess.PIPE).stdout
lines = git_log_r.readlines()
git_log_r.close()

Expand Down Expand Up @@ -186,7 +186,7 @@ def __init__(self, repo, hard):
self.commits = []
interval.set_ref("HEAD");
git_rev_list_p = subprocess.Popen(filter(None, ["git", "rev-list", "--reverse", "--no-merges",
interval.get_since(), interval.get_until(), "HEAD"]), bufsize=1,
interval.get_since(), interval.get_until(), "HEAD"]),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
lines = git_rev_list_p.communicate()[0].splitlines()
git_rev_list_p.stdout.close()
Expand Down
2 changes: 1 addition & 1 deletion gitinspector/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, name, location):
if parsed_url.scheme == "file" or parsed_url.scheme == "git" or parsed_url.scheme == "http" or \
parsed_url.scheme == "https" or parsed_url.scheme == "ssh":
path = tempfile.mkdtemp(suffix=".gitinspector")
git_clone = subprocess.Popen(["git", "clone", url, path], bufsize=1, stdout=sys.stderr)
git_clone = subprocess.Popen(["git", "clone", url, path], stdout=sys.stderr)
git_clone.wait()

if git_clone.returncode != 0:
Expand Down
2 changes: 1 addition & 1 deletion gitinspector/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __read_git_config__(self, variable):
previous_directory = os.getcwd()
os.chdir(self.repo)
setting = subprocess.Popen(filter(None, ["git", "config", "--global" if self.global_only else "",
"inspector." + variable]), bufsize=1, stdout=subprocess.PIPE).stdout
"inspector." + variable]), stdout=subprocess.PIPE).stdout
os.chdir(previous_directory)

try:
Expand Down
2 changes: 1 addition & 1 deletion gitinspector/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def has_filtered():
return False

def __find_commit_message__(sha):
git_show_r = subprocess.Popen(filter(None, ["git", "show", "-s", "--pretty=%B", "-w", sha]), bufsize=1,
git_show_r = subprocess.Popen(filter(None, ["git", "show", "-s", "--pretty=%B", "-w", sha]),
stdout=subprocess.PIPE).stdout

commit_message = git_show_r.read()
Expand Down
6 changes: 3 additions & 3 deletions gitinspector/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def init():

__enabled__ = True
__installed__ = True
__translation__.install(True)
__translation__.install()

def check_compatibility(version):
if isinstance(__translation__, gettext.GNUTranslations):
Expand All @@ -93,7 +93,7 @@ def get_date():

def enable():
if isinstance(__translation__, gettext.GNUTranslations):
__translation__.install(True)
__translation__.install()

global __enabled__
__enabled__ = True
Expand All @@ -103,4 +103,4 @@ def disable():
__enabled__ = False

if __installed__:
gettext.NullTranslations().install(True)
gettext.NullTranslations().install()
6 changes: 3 additions & 3 deletions gitinspector/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self):
self.cyclomatic_complexity = {}
self.cyclomatic_complexity_density = {}

ls_tree_p = subprocess.Popen(["git", "ls-tree", "--name-only", "-r", interval.get_ref()], bufsize=1,
ls_tree_p = subprocess.Popen(["git", "ls-tree", "--name-only", "-r", interval.get_ref()],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
lines = ls_tree_p.communicate()[0].splitlines()
ls_tree_p.stdout.close()
Expand All @@ -57,7 +57,7 @@ def __init__(self):

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()
stdout=subprocess.PIPE).stdout.readlines()

extension = FileDiff.get_extension(i)
lines = MetricsLogic.get_eloc(file_r, extension)
Expand All @@ -79,7 +79,7 @@ def __iadd__(self, other):
self.cyclomatic_complexity_density.update(other.cyclomatic_complexity_density)
return self
except AttributeError:
return other;
return other

@staticmethod
def get_cyclomatic_complexity(file_r, extension):
Expand Down