From 2dd4c2c4fffc756d36772c85c34549336d6d4a52 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Mon, 6 May 2013 13:12:27 +0200 Subject: [PATCH] Fixed the XML output of the timeline. The output was simply wrong and was outputting extra "" tags all over the place. Also, whenever there was very little work, this was not included in the timeline. --- timeline.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/timeline.py b/timeline.py index 7566b84..b1a1810 100644 --- a/timeline.py +++ b/timeline.py @@ -200,20 +200,21 @@ class Timeline(Outputable): for period in periods: name_xml = "\t\t\t\t" + str(period) + "\n" - authors_xml = "" + authors_xml = "\t\t\t\t\n" for name in names: - authors_xml += "\t\t\t\t\n" - multiplier = timeline_data.get_multiplier(period, 24) - signs = timeline_data.get_author_signs_in_period(name, period, multiplier) - signs_str = (signs[1] * "-" + signs[0] * "+") + if timeline_data.is_author_in_period(period, name): + multiplier = timeline_data.get_multiplier(period, 24) + signs = timeline_data.get_author_signs_in_period(name, period, multiplier) + signs_str = (signs[1] * "-" + signs[0] * "+") + + if len(signs_str) == 0: + signs_str = "." - if not len(signs_str) == 0: authors_xml += "\t\t\t\t\t\n\t\t\t\t\t\t" + name + "\n" authors_xml += "\t\t\t\t\t\t" + signs_str + "\n\t\t\t\t\t\n" - authors_xml += "\t\t\t\t\n" - + authors_xml += "\t\t\t\t\n" modified_rows_xml = "\t\t\t\t" + \ str(timeline_data.get_total_changes_in_period(period)[2]) + "\n" timeline_xml += "\t\t\t\n" + name_xml + authors_xml + modified_rows_xml + "\t\t\t\n"