From 56ac90c26de76167871ec489260580c2c5cf0d4d Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Thu, 8 Oct 2009 22:18:50 +0200 Subject: [PATCH] Reworked the html command template system --- .../06e45775-1c46-4793-a34e-2cc86a8db097/body | 1 + .../values | 8 ++++ .../values | 2 +- becommands/html.py | 47 +++++++++---------- 4 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 .be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/body create mode 100644 .be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/values diff --git a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/body b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/body new file mode 100644 index 0000000..c5f1b4f --- /dev/null +++ b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/body @@ -0,0 +1 @@ +Added the option in my be-html branch diff --git a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/values b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/values new file mode 100644 index 0000000..f7b7498 --- /dev/null +++ b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/comments/06e45775-1c46-4793-a34e-2cc86a8db097/values @@ -0,0 +1,8 @@ +Author: Gianluca Montecchi + + +Content-type: text/plain + + +Date: Thu, 08 Oct 2009 20:16:46 +0000 + diff --git a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values index 8b58566..1b71be1 100644 --- a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values +++ b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values @@ -7,7 +7,7 @@ reporter: gianluca severity: wishlist -status: open +status: closed summary: Add a verbose option? 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