mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-30 03:11:29 +02:00
Empty rows are now skipped in the timeline output.
In practice, this means that whenever an author is not part of a collection of periods he will not be printed out. This cleans up the output and also speeds up analysis.
This commit is contained in:
parent
2dd4c2c4ff
commit
0c6358324d
12
timeline.py
12
timeline.py
@ -95,6 +95,12 @@ class TimelineData:
|
|||||||
def is_author_in_period(self, period, author):
|
def is_author_in_period(self, period, author):
|
||||||
return self.entries.get((author, period), None) != None
|
return self.entries.get((author, period), None) != None
|
||||||
|
|
||||||
|
def is_author_in_periods(self, periods, author):
|
||||||
|
for period in periods:
|
||||||
|
if self.is_author_in_period(period, author):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
__timeline_info_text__ = "The following history timeline has been gathered from the repository"
|
__timeline_info_text__ = "The following history timeline has been gathered from the repository"
|
||||||
|
|
||||||
def __output_row__text__(timeline_data, periods, names):
|
def __output_row__text__(timeline_data, periods, names):
|
||||||
@ -106,6 +112,7 @@ def __output_row__text__(timeline_data, periods, names):
|
|||||||
print(terminal.__normal__)
|
print(terminal.__normal__)
|
||||||
|
|
||||||
for name in names:
|
for name in names:
|
||||||
|
if timeline_data.is_author_in_periods(periods, name):
|
||||||
print(name.ljust(20)[0:20], end=" ")
|
print(name.ljust(20)[0:20], end=" ")
|
||||||
for period in periods:
|
for period in periods:
|
||||||
multiplier = timeline_data.get_multiplier(period, 9)
|
multiplier = timeline_data.get_multiplier(period, 9)
|
||||||
@ -130,8 +137,10 @@ def __output_row__html__(timeline_data, periods, names):
|
|||||||
timeline_xml += "<th>" + str(period) + "</th>"
|
timeline_xml += "<th>" + str(period) + "</th>"
|
||||||
|
|
||||||
timeline_xml += "</tr></thead><tbody>"
|
timeline_xml += "</tr></thead><tbody>"
|
||||||
|
i = 0
|
||||||
|
|
||||||
for i, name in enumerate(names):
|
for name in names:
|
||||||
|
if timeline_data.is_author_in_periods(periods, name):
|
||||||
timeline_xml += "<tr" + (" class=\"odd\">" if i % 2 == 1 else ">")
|
timeline_xml += "<tr" + (" class=\"odd\">" if i % 2 == 1 else ">")
|
||||||
timeline_xml += "<td>" + name + "</td>"
|
timeline_xml += "<td>" + name + "</td>"
|
||||||
for period in periods:
|
for period in periods:
|
||||||
@ -142,6 +151,7 @@ def __output_row__html__(timeline_data, periods, names):
|
|||||||
timeline_xml += "<td>" + ("." if timeline_data.is_author_in_period(period, name) and len(signs_str) == 0 else signs_str)
|
timeline_xml += "<td>" + ("." if timeline_data.is_author_in_period(period, name) and len(signs_str) == 0 else signs_str)
|
||||||
timeline_xml += "</td>"
|
timeline_xml += "</td>"
|
||||||
timeline_xml += "</tr>"
|
timeline_xml += "</tr>"
|
||||||
|
i = i + 1
|
||||||
|
|
||||||
timeline_xml += "<tfoot><tr><td><strong>Modified Rows:</strong></td>"
|
timeline_xml += "<tfoot><tr><td><strong>Modified Rows:</strong></td>"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user