The responsibilities module no longer prints empty authors.

This commit is contained in:
Adam Waldenberg 2013-05-20 02:20:29 +02:00
parent fe3f067d6a
commit 128b8b3b56

View file

@ -52,8 +52,9 @@ class ResponsibilitiesOutput(Outputable):
print("\n" + textwrap.fill(__responsibilities_info_text__ + ":", width=terminal.get_size()[0]))
for i in sorted(set(i[0] for i in blame.get(self.hard).blames)):
print("\n" + i, "is mostly responsible for:")
responsibilities = sorted(((i[1], i[0]) for i in Responsibilities.get(self.hard, i)), reverse=True)
if responsibilities:
print("\n" + i, "is mostly responsible for:")
for j, entry in enumerate(responsibilities):
(width, _) = terminal.get_size()
@ -70,8 +71,9 @@ class ResponsibilitiesOutput(Outputable):
resp_xml += "<p>" + __responsibilities_info_text__ + ".</p>"
for i in sorted(set(i[0] for i in blame.get(self.hard).blames)):
resp_xml += "<h3>" + i + "is mostly responsible for</h3>"
responsibilities = sorted(((i[1], i[0]) for i in Responsibilities.get(self.hard, i)), reverse=True)
if responsibilities:
resp_xml += "<h3>" + i + "is mostly responsible for</h3>"
for j, entry in enumerate(responsibilities):
resp_xml += "<p>" + entry[1] + " (" + str(entry[0]) + " eloc)</p>"
@ -87,10 +89,11 @@ class ResponsibilitiesOutput(Outputable):
resp_xml = ""
for i in sorted(set(i[0] for i in blame.get(self.hard).blames)):
responsibilities = sorted(((i[1], i[0]) for i in Responsibilities.get(self.hard, i)), reverse=True)
if responsibilities:
resp_xml += "\t\t\t<author>\n"
resp_xml += "\t\t\t\t<name>" + i + "</name>\n"
resp_xml += "\t\t\t\t<files>\n"
responsibilities = sorted(((i[1], i[0]) for i in Responsibilities.get(self.hard, i)), reverse=True)
for j, entry in enumerate(responsibilities):
resp_xml += "\t\t\t\t\t<file>\n"