From 2b4f40e85691650d79e14a5a0884853de52d68fa Mon Sep 17 00:00:00 2001 From: Chris Liddell Date: Mon, 30 Jan 2012 17:41:35 +0000 Subject: Improve the html output of the changelog generator. There were some compatibility problems with the html from the git log to html changelog generator - such as including '<' and '>' characters in text to be displayed. Also, improve the actual formatting slightly. CLUSTER_UNTESTED --- gs/toolbin/gitlog2changelog.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gs/toolbin/gitlog2changelog.py b/gs/toolbin/gitlog2changelog.py index a20a86175..a3dc5ce6a 100755 --- a/gs/toolbin/gitlog2changelog.py +++ b/gs/toolbin/gitlog2changelog.py @@ -16,6 +16,7 @@ import sys import string import datetime import time +import codecs argc = len(sys.argv) if argc < 3: @@ -52,7 +53,7 @@ else: res = os.popen(cmd, "r") commit=res.readlines() # This assumes the order of the lines..... - sys.stdout.write("

") if str.find(commit[1], "Merge:") < 0: nm = commit[1] dt = commit[2] @@ -63,21 +64,28 @@ else: logidx = 4 sys.stdout.write (dt.split("Date:")[1].strip()) - sys.stdout.write (">\n") - sys.stdout.write (dt.split("Date:")[1].strip()) - sys.stdout.write ("\n
" + nm.split("Author: ")[1].strip() + "
\n") + sys.stdout.write ("\n") + auth_name=nm.split("Author: ")[1].strip() + sys.stdout.write ("
\n
" + auth_name.replace("<", "<").replace(">", ">") + "
\n") sys.stdout.write ("") sys.stdout.write (commit[0].split("commit ")[1].strip() + "\n") sys.stdout.write ("

\n") + sys.stdout.write ("

\n") log = commit[logidx:] + marked = 0 + # this loop needs to skip initial blank lines for logline in log: - sys.stdout.write (logline + "
\n") + if len(logline.strip()) == 0 and marked == 0 : + continue + sys.stdout.write (logline.replace("<", "<").replace(">", ">") + "
\n") + marked = 1 sys.stdout.write ("

\n") sys.stdout.write ("

\n") - sys.stdout.write ("\n") + sys.stdout.write ("
\n") + sys.stdout.write ("
\n\n\n") sys.stdout.write ("\n") sys.stdout.write ("\n") -- cgit v1.2.3