mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 19:32:16 +01:00
The changes module now also outputs the progress when in text mode.
Furthermore, the output also shows the pass currently running. This is important, as the progress goes from 0 to 100%, twice.
This commit is contained in:
parent
ce91c4176a
commit
d30715cc84
3 changed files with 12 additions and 2 deletions
|
@ -119,7 +119,7 @@ class BlameThread(threading.Thread):
|
||||||
|
|
||||||
__thread_lock__.release() # Lock controlling the number of threads running
|
__thread_lock__.release() # Lock controlling the number of threads running
|
||||||
|
|
||||||
PROGRESS_TEXT = N_("Checking how many rows belong to each author (Progress): {0:.0f}%")
|
PROGRESS_TEXT = N_("Checking how many rows belong to each author (2 of 2): {0:.0f}%")
|
||||||
|
|
||||||
class Blame(object):
|
class Blame(object):
|
||||||
def __init__(self, hard, useweeks, changes):
|
def __init__(self, hard, useweeks, changes):
|
||||||
|
|
|
@ -23,7 +23,8 @@ import multiprocessing
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
from . import extensions, filtering, interval
|
from .localization import N_
|
||||||
|
from . import extensions, filtering, format, interval, terminal
|
||||||
|
|
||||||
CHANGES_PER_THREAD = 200
|
CHANGES_PER_THREAD = 200
|
||||||
NUM_THREADS = multiprocessing.cpu_count()
|
NUM_THREADS = multiprocessing.cpu_count()
|
||||||
|
@ -167,6 +168,8 @@ class ChangesThread(threading.Thread):
|
||||||
__changes_lock__.release() # ...to here.
|
__changes_lock__.release() # ...to here.
|
||||||
__thread_lock__.release() # Lock controlling the number of threads running
|
__thread_lock__.release() # Lock controlling the number of threads running
|
||||||
|
|
||||||
|
PROGRESS_TEXT = N_("Fetching and calculating primary statistics (1 of 2): {0:.0f}%")
|
||||||
|
|
||||||
class Changes(object):
|
class Changes(object):
|
||||||
authors = {}
|
authors = {}
|
||||||
authors_dateinfo = {}
|
authors_dateinfo = {}
|
||||||
|
@ -191,6 +194,9 @@ class Changes(object):
|
||||||
second_hash = entry
|
second_hash = entry
|
||||||
ChangesThread.create(hard, self, first_hash, second_hash, i)
|
ChangesThread.create(hard, self, first_hash, second_hash, i)
|
||||||
first_hash = entry + ".."
|
first_hash = entry + ".."
|
||||||
|
|
||||||
|
if format.is_interactive_format():
|
||||||
|
terminal.output_progress(_(PROGRESS_TEXT), i, len(lines))
|
||||||
else:
|
else:
|
||||||
entry = entry.decode("utf-8", "replace").strip()
|
entry = entry.decode("utf-8", "replace").strip()
|
||||||
second_hash = entry
|
second_hash = entry
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
from ..localization import N_
|
from ..localization import N_
|
||||||
from .. import format, gravatar, terminal
|
from .. import format, gravatar, terminal
|
||||||
|
@ -128,6 +129,9 @@ class ChangesOutput(Outputable):
|
||||||
print("\t\t\"exception\": \"" + _(NO_COMMITED_FILES_TEXT) + "\"")
|
print("\t\t\"exception\": \"" + _(NO_COMMITED_FILES_TEXT) + "\"")
|
||||||
|
|
||||||
def output_text(self):
|
def output_text(self):
|
||||||
|
if sys.stdout.isatty() and format.is_interactive_format():
|
||||||
|
terminal.clear_row()
|
||||||
|
|
||||||
authorinfo_list = self.changes.get_authorinfo_list()
|
authorinfo_list = self.changes.get_authorinfo_list()
|
||||||
total_changes = 0.0
|
total_changes = 0.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue