From 56ac90c26de76167871ec489260580c2c5cf0d4d Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Thu, 8 Oct 2009 22:18:50 +0200 Subject: Reworked the html command template system --- becommands/html.py | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'becommands') diff --git a/becommands/html.py b/becommands/html.py index 38b6012..d5c4771 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -456,7 +456,7 @@ class BEHTMLGen(): %s - + %s @@ -472,21 +472,14 @@ class BEHTMLGen(): %s%s """ - - self.comment_section = """ - """ - - self.begin_comment_section =""" + self.comment_section =""" Comments: - """ - - - self.end_comment_section =""" + %s """ @@ -511,7 +504,12 @@ class BEHTMLGen(): FI.close() except: pass - + try: + FI.open("%s/comment_section.tpl"%self.template) + self.comment_section = FI.read() + FI.close() + except: + pass def create_index_file(self, out_dir_path, summary, bugs, ordered_bug, fileid, encoding): @@ -602,21 +600,16 @@ class BEHTMLGen(): det_line += self.detail_line%("Created : ", escape(bug.time_string)) det_line += self.detail_line%("Summary : ", escape(bug.summary)) det_line += """
""" - - if fileid == "active": - FD.write(detail_file_%(encoding, "../index.html", det_line, "../index.html")) - if fileid == "inactive": - FD.write(detail_file_%(encoding, "../index_inactive.html", det_line, "../index_inactive.html")) - - FD.write(self.begin_comment_section) + tr = [] b = '' level = 0 stack = [] + com = "" for depth,comment in bug_.comment_root.thread(flatten=False): while len(stack) > depth: stack.pop(-1) # pop non-parents off the stack - FD.write("\n") # close non-parent
\n" # close non-parent
') + com += '
' else: - FD.write('
') - FD.write("
\n".join(lines)+"
\n") + com += '
' + #FD.write("
\n".join(lines)+"
\n") + com += "
\n".join(lines)+"
\n" while len(stack) > 0: stack.pop(-1) - FD.write("
\n") # close every remaining
\n" # close every remaining