From ab16d23c3d82c427e0c4e969573db6e087e9f2dc Mon Sep 17 00:00:00 2001 From: gianluca Date: Sat, 4 Jul 2009 00:57:18 +0200 Subject: Initial implementation of the html repository export. Creation of the index file --- becommands/html.py | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 becommands/html.py (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py new file mode 100644 index 0000000..cc64c7d --- /dev/null +++ b/becommands/html.py @@ -0,0 +1,107 @@ +# Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc. +# Marien Zwart +# Thomas Gerigk +# W. Trevor King +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +"""Re-open a bug""" +from libbe import cmdutil, bugdir, bug +from html_data import * +import os, re + +__desc__ = __doc__ + +def execute(args, test=False): + """ + >>> import os + >>> bd = bugdir.simple_bug_dir() + >>> os.chdir(bd.root) + >>> print bd.bug_from_shortname("b").status + closed + >>> execute(["b"], test=True) + >>> bd._clear_bugs() + >>> print bd.bug_from_shortname("b").status + open + """ + parser = get_parser() + options, args = parser.parse_args(args) + cmdutil.default_complete(options, args, parser, + bugid_args={0: lambda bug : bug.active==False}) + if len(args) == 0: + out_dir = './html_export' + print "Creating the html output in ./html_export" + else: + out_dir = args[0] + if len(args) > 1: + raise cmdutil.UsageError, "Too many arguments." + + bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) + bd.load_all_bugs() + status_list = bug.status_values + severity_list = bug.severity_values + st = {} + se = {} + + for s in status_list: + st[s] = 0 + for s in severity_list: + se[s] = 0 + for b in bd: + st[b.status] += 1 + se[b.severity] += 1 + create_index_file(out_dir, st, se) + +def create_index_file(out_dir_path, summary, severity): + try: + os.stat(out_dir_path) + except: + try: + os.mkdir(out_dir_path) + except: + raise cmdutil.UsageError, "Cannot create output directory." + try: + FO = open(out_dir_path+"/style.css", "w") + FO.write(css_file) + FO.close() + except: + raise cmdutil.UsageError, "Cannot create the style.css file." + value = html_index + for stat in summary: + rep = "_"+stat+"_" + val = str(summary[stat]) + value = re.sub(rep, val, value) + for sev in severity: + rep = "_"+sev+"_" + val = str(severity[sev]) + value = re.sub(rep, val, value) + try: + FO = open(out_dir_path+"/index.html", "w") + FO.write(value) + FO.close() + except: + raise cmdutil.UsageError, "Cannot create the index.html file." + + +def get_parser(): + parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") + return parser + +longhelp=""" +Generate a set of html pages. +""" + +def help(): + return get_parser().help_str() + longhelp -- cgit From 98f16c2d4daaaafae20f31879bbb5bd0cbaa8d49 Mon Sep 17 00:00:00 2001 From: gianluca Date: Thu, 9 Jul 2009 00:49:24 +0200 Subject: Added the last 10 bug open list --- becommands/html.py | 95 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 33 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index cc64c7d..df7a99f 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -20,7 +20,7 @@ """Re-open a bug""" from libbe import cmdutil, bugdir, bug from html_data import * -import os, re +import os, re, time __desc__ = __doc__ @@ -54,46 +54,20 @@ def execute(args, test=False): severity_list = bug.severity_values st = {} se = {} - + stime = {} for s in status_list: st[s] = 0 for s in severity_list: se[s] = 0 + for b in bd: + stime[b.uuid] = b.time st[b.status] += 1 se[b.severity] += 1 - create_index_file(out_dir, st, se) + stime_sorted = sorted([(value,key) for (key,value) in stime.items()]) -def create_index_file(out_dir_path, summary, severity): - try: - os.stat(out_dir_path) - except: - try: - os.mkdir(out_dir_path) - except: - raise cmdutil.UsageError, "Cannot create output directory." - try: - FO = open(out_dir_path+"/style.css", "w") - FO.write(css_file) - FO.close() - except: - raise cmdutil.UsageError, "Cannot create the style.css file." - value = html_index - for stat in summary: - rep = "_"+stat+"_" - val = str(summary[stat]) - value = re.sub(rep, val, value) - for sev in severity: - rep = "_"+sev+"_" - val = str(severity[sev]) - value = re.sub(rep, val, value) - try: - FO = open(out_dir_path+"/index.html", "w") - FO.write(value) - FO.close() - except: - raise cmdutil.UsageError, "Cannot create the index.html file." - + html_gen = BEHTMLGen() + html_gen.create_index_file(out_dir, st, se, stime_sorted) def get_parser(): parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") @@ -105,3 +79,58 @@ Generate a set of html pages. def help(): return get_parser().help_str() + longhelp + + +class BEHTMLGen(): + def __init__(self): + self.index_value = "" + + def create_index_file(self, out_dir_path, summary, severity, last_bug): + try: + os.stat(out_dir_path) + except: + try: + os.mkdir(out_dir_path) + except: + raise cmdutil.UsageError, "Cannot create output directory." + try: + FO = open(out_dir_path+"/style.css", "w") + FO.write(css_file) + FO.close() + except: + raise cmdutil.UsageError, "Cannot create the style.css file." + value = html_index + for stat in summary: + rep = "_"+stat+"_" + val = str(summary[stat]) + value = re.sub(rep, val, value) + for sev in severity: + rep = "_"+sev+"_" + val = str(severity[sev]) + value = re.sub(rep, val, value) + + c = 0 + t = len(last_bug)-1 + for l in range(t, 0, -1): + line = "" + line = re.sub('_BUG_ID_', last_bug[l][1], last_activity) + line1 = re.sub('_BUG_', last_bug[l][1][0:3], line) + line2 = re.sub('_DATE_', time.ctime(last_bug[l][0]), line1) + if c%2 == 0: + linef = re.sub('_ROW_', "even-row", line2) + else: + linef = re.sub('_ROW_', "odd-row", line2) + self.index_value += linef + c += 1 + if c == 10: + break + + value = re.sub("_LAST_ACTVITY_", self.index_value, value) + + try: + FO = open(out_dir_path+"/index.html", "w") + FO.write(value) + FO.close() + except: + raise cmdutil.UsageError, "Cannot create the index.html file." + -- cgit From 80d4ea738b62f0a958bb3924b9f4c46d810bcd14 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Sun, 19 Jul 2009 00:58:14 +0200 Subject: Created the index --- becommands/html.py | 78 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 32 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index df7a99f..224c876 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -55,19 +55,19 @@ def execute(args, test=False): st = {} se = {} stime = {} + bugs = [] for s in status_list: st[s] = 0 - for s in severity_list: - se[s] = 0 - for b in bd: stime[b.uuid] = b.time + if b.status == "open": + bugs.append(b) st[b.status] += 1 - se[b.severity] += 1 - stime_sorted = sorted([(value,key) for (key,value) in stime.items()]) - + ordered_bug_list = sorted([(value,key) for (key,value) in stime.items()]) + #open_bug_list = sorted([(value,key) for (key,value) in bugs.items()]) + html_gen = BEHTMLGen() - html_gen.create_index_file(out_dir, st, se, stime_sorted) + html_gen.create_index_file(out_dir, st, bugs, ordered_bug_list) def get_parser(): parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") @@ -85,7 +85,7 @@ class BEHTMLGen(): def __init__(self): self.index_value = "" - def create_index_file(self, out_dir_path, summary, severity, last_bug): + def create_index_file(self, out_dir_path, summary, bugs, ordered_bug): try: os.stat(out_dir_path) except: @@ -99,38 +99,52 @@ class BEHTMLGen(): FO.close() except: raise cmdutil.UsageError, "Cannot create the style.css file." - value = html_index - for stat in summary: - rep = "_"+stat+"_" - val = str(summary[stat]) - value = re.sub(rep, val, value) - for sev in severity: - rep = "_"+sev+"_" - val = str(severity[sev]) - value = re.sub(rep, val, value) + try: + os.mkdir(out_dir_path+"/bugs") + except: + pass + + try: + FO = open(out_dir_path+"/index.html", "w") + except: + raise cmdutil.UsageError, "Cannot create the index.html file." + + FO.write(index_first) c = 0 - t = len(last_bug)-1 + t = len(bugs) - 1 for l in range(t, 0, -1): - line = "" - line = re.sub('_BUG_ID_', last_bug[l][1], last_activity) - line1 = re.sub('_BUG_', last_bug[l][1][0:3], line) - line2 = re.sub('_DATE_', time.ctime(last_bug[l][0]), line1) + line = bug_line + line1 = re.sub('_bug_id_link_', bugs[l].uuid, line) + line = line1 + line1 = re.sub('_bug_id_', bugs[l].uuid[0:3], line) + line = line1 + line1 = re.sub('_status_', bugs[l].status, line) + line = line1 + line1 = re.sub('_sev_', bugs[l].severity, line) + line = line1 + line1 = re.sub('_descr_', bugs[l].summary, line) + line = line1 + line2 = re.sub('_time_', time.ctime(bugs[l].time), line1) if c%2 == 0: linef = re.sub('_ROW_', "even-row", line2) else: linef = re.sub('_ROW_', "odd-row", line2) - self.index_value += linef + FO.write(linef) c += 1 - if c == 10: - break - - value = re.sub("_LAST_ACTVITY_", self.index_value, value) + self.CreateDetailFile(bugs[l], out_dir_path) + FO.write(index_last) + + def CreateDetailFile(self, bug, out_dir_path): + f = "%s.html"%bug.uuid + p = out_dir_path+"/bugs/"+f try: - FO = open(out_dir_path+"/index.html", "w") - FO.write(value) - FO.close() + FD = open(p, "w") except: - raise cmdutil.UsageError, "Cannot create the index.html file." - + raise cmdutil.UsageError, "Cannot create the detail html file." + + FD.write(index_first) + + FD.write(index_last) + FD.close() \ No newline at end of file -- cgit From 4d2f044142754e4c03c4fe9b4fd2ca9f93bb53b9 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Tue, 21 Jul 2009 00:51:37 +0200 Subject: implemented the detail file and fixed the list of active bug --- becommands/html.py | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 224c876..ce9fb7b 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -60,7 +60,7 @@ def execute(args, test=False): st[s] = 0 for b in bd: stime[b.uuid] = b.time - if b.status == "open": + if b.status in ["open", "test", "unconfirmed", "assigned"]: bugs.append(b) st[b.status] += 1 ordered_bug_list = sorted([(value,key) for (key,value) in stime.items()]) @@ -113,24 +113,16 @@ class BEHTMLGen(): FO.write(index_first) c = 0 t = len(bugs) - 1 - for l in range(t, 0, -1): - line = bug_line - line1 = re.sub('_bug_id_link_', bugs[l].uuid, line) - line = line1 - line1 = re.sub('_bug_id_', bugs[l].uuid[0:3], line) - line = line1 - line1 = re.sub('_status_', bugs[l].status, line) - line = line1 - line1 = re.sub('_sev_', bugs[l].severity, line) - line = line1 - line1 = re.sub('_descr_', bugs[l].summary, line) - line = line1 - line2 = re.sub('_time_', time.ctime(bugs[l].time), line1) - if c%2 == 0: - linef = re.sub('_ROW_', "even-row", line2) - else: - linef = re.sub('_ROW_', "odd-row", line2) - FO.write(linef) + for l in range(t, -1, -1): + line = bug_line%(bugs[l].status, + bugs[l].uuid, bugs[l].uuid[0:3], + bugs[l].uuid, bugs[l].status, + bugs[l].uuid, bugs[l].severity, + bugs[l].uuid, bugs[l].summary, + bugs[l].uuid, bugs[l].time_string + ) + print line + FO.write(line) c += 1 self.CreateDetailFile(bugs[l], out_dir_path) FO.write(index_last) @@ -143,8 +135,23 @@ class BEHTMLGen(): FD = open(p, "w") except: raise cmdutil.UsageError, "Cannot create the detail html file." + + detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], detail_first) + FD.write(detail_first_) + bug.load_comments() - FD.write(index_first) - - FD.write(index_last) + c = bug.comment_root + print c.body + FD.write(detail_line%("ID : ", bug.uuid)) + FD.write(detail_line%("Short name : ", bug.uuid[0:3])) + FD.write(detail_line%("Severity : ", bug.severity)) + FD.write(detail_line%("Status : ", bug.status)) + FD.write(detail_line%("Assigned : ", bug.assigned)) + FD.write(detail_line%("Target : ", bug.target)) + FD.write(detail_line%("Reporter : ", bug.reporter)) + FD.write(detail_line%("Creator : ", bug.creator)) + FD.write(detail_line%("Created : ", bug.time_string)) + FD.write(detail_line%("Summary : ", bug.summary)) + FD.write("") + FD.write(detail_last) FD.close() \ No newline at end of file -- cgit From 694e2bfbdf64e2c50efae81aa848777b65e6dc0a Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Tue, 21 Jul 2009 23:51:33 +0200 Subject: Initial implementation of the comments export --- becommands/html.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index ce9fb7b..b0441b9 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -66,7 +66,7 @@ def execute(args, test=False): ordered_bug_list = sorted([(value,key) for (key,value) in stime.items()]) #open_bug_list = sorted([(value,key) for (key,value) in bugs.items()]) - html_gen = BEHTMLGen() + html_gen = BEHTMLGen(bd) html_gen.create_index_file(out_dir, st, bugs, ordered_bug_list) def get_parser(): @@ -82,8 +82,9 @@ def help(): class BEHTMLGen(): - def __init__(self): - self.index_value = "" + def __init__(self, bd): + self.index_value = "" + self.bd = bd def create_index_file(self, out_dir_path, summary, bugs, ordered_bug): try: @@ -121,7 +122,6 @@ class BEHTMLGen(): bugs[l].uuid, bugs[l].summary, bugs[l].uuid, bugs[l].time_string ) - print line FO.write(line) c += 1 self.CreateDetailFile(bugs[l], out_dir_path) @@ -138,10 +138,14 @@ class BEHTMLGen(): detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], detail_first) FD.write(detail_first_) - bug.load_comments() - c = bug.comment_root - print c.body + + + bug_ = self.bd.bug_from_shortname(bug.uuid[0:3]) + bug_.load_comments(load_full=True) + for i in bug_.comments(): + print i.uuid, i.in_reply_to + FD.write(detail_line%("ID : ", bug.uuid)) FD.write(detail_line%("Short name : ", bug.uuid[0:3])) FD.write(detail_line%("Severity : ", bug.severity)) -- cgit From d2cdec6be03037269c41b1726252c9d1420a13a5 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Mon, 27 Jul 2009 23:59:40 +0200 Subject: Moved all the implementation into the html.py file Implemented the creation of the index for active and inactive bugs, with detail for earch of them --- becommands/html.py | 465 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 435 insertions(+), 30 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index b0441b9..3f6d923 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -19,8 +19,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Re-open a bug""" from libbe import cmdutil, bugdir, bug -from html_data import * -import os, re, time +#from html_data import * +import os, re, time, string __desc__ = __doc__ @@ -55,19 +55,24 @@ def execute(args, test=False): st = {} se = {} stime = {} - bugs = [] + bugs_active = [] + bugs_inactive = [] for s in status_list: st[s] = 0 for b in bd: stime[b.uuid] = b.time if b.status in ["open", "test", "unconfirmed", "assigned"]: - bugs.append(b) + bugs_active.append(b) + else: + bugs_inactive.append(b) st[b.status] += 1 ordered_bug_list = sorted([(value,key) for (key,value) in stime.items()]) + ordered_bug_list_in = sorted([(value,key) for (key,value) in stime.items()]) #open_bug_list = sorted([(value,key) for (key,value) in bugs.items()]) html_gen = BEHTMLGen(bd) - html_gen.create_index_file(out_dir, st, bugs, ordered_bug_list) + html_gen.create_index_file(out_dir, st, bugs_active, ordered_bug_list, "active") + html_gen.create_index_file(out_dir, st, bugs_inactive, ordered_bug_list, "inactive") def get_parser(): parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") @@ -86,7 +91,363 @@ class BEHTMLGen(): self.index_value = "" self.bd = bd - def create_index_file(self, out_dir_path, summary, bugs, ordered_bug): + self.css_file = """ + body { + font-family: "lucida grande", "sans serif"; + color: #333; + width: 60em; + margin: auto; + } + + + div.main { + padding: 20px; + margin: auto; + padding-top: 0; + margin-top: 1em; + background-color: #fcfcfc; + } + + .comment { + padding: 20px; + margin: auto; + padding-top: 20px; + margin-top: 0; + } + + .commentF { + padding: 0px; + margin: auto; + padding-top: 20px; + paddin-bottom: 40px; + margin-top: 0; + } + + tb { + border = 1; + } + + .open-row { + background-color: #e9e9e2; + width: 5%; + } + + .assigned-row { + background-color: #f9f9f9; + width: 5%; + } + + + .test-row { + background-color: #f9f9f9; + width: 5%; + } + + .unconfirmed-row { + background-color: #f9f9f9; + width: 5%; + } + + .fixed-row { + background-color: #f9f9f9; + width: 5%; + } + + .closed-row { + background-color: #f9f9f9; + width: 5%; + } + + .wontfix-row { + background-color: #f9f9f9; + width: 5%; + } + + + .person { + font-family: courier; + } + + a, a:visited { + background: inherit; + text-decoration: none; + } + + a { + color: #003d41; + } + + a:visited { + color: #553d41; + } + + ul { + list-style-type: none; + padding: 0; + } + + p { + width: 40em; + } + + .inline-status-image { + position: relative; + top: 0.2em; + } + + .dimmed { + color: #bbb; + } + + table { + border-style: none; + border-spacing: 0; + } + + table.log { + } + + + td { + border-width: 0; + border-style: none; + padding-right: 0.5em; + padding-left: 0.5em; + } + + tr { + vertical-align: top; + } + + h1 { + padding: 0.5em; + background-color: #305275; + margin-top: 0; + margin-bottom: 0; + color: #fff; + margin-left: -20px; + margin-right: -20px; + } + + h2 { + text-transform: uppercase; + font-size: smaller; + margin-top: 1em; + margin-left: -0.5em; + /*background: #fffbce;*/ + /*background: #628a0d;*/ + padding: 5px; + color: #305275; + } + + + + .attrname { + text-align: right; + font-size: smaller; + } + + .attrval { + color: #222; + } + + .issue-closed-fixed { + background-image: "green-check.png"; + } + + .issue-closed-wontfix { + background-image: "red-check.png"; + } + + .issue-closed-reorg { + background-image: "blue-check.png"; + } + + .inline-issue-link { + text-decoration: underline; + } + + img { + border: 0; + } + + + div.footer { + font-size: small; + padding-left: 20px; + padding-right: 20px; + padding-top: 5px; + padding-bottom: 5px; + margin: auto; + background: #305275; + color: #fffee7; + } + + .footer a { + color: #508d91; + } + + + .header { + font-family: "lucida grande", "sans serif"; + font-size: smaller; + background-color: #a9a9a9; + text-align: left; + + padding-right: 0.5em; + padding-left: 0.5em; + + } + + + .selected-cell { + background-color: #e9e9e2; + } + + .plain-cell { + background-color: #f9f9f9; + } + + .backptr { + font-size: smaller; + width: 100%; + text-align: left; + padding-bottom: 1em; + margin-top: 0; + } + + .logcomment { + padding-left: 4em; + font-size: smaller; + } + + .id { + font-family: courier; + } + + .description { + background: #f2f2f2; + padding-left: 1em; + padding-right: 1em; + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .message { + } + + .littledate { + font-size: smaller; + } + + .progress-meter-done { + background-color: #03af00; + } + + .progress-meter-undone { + background-color: #ddd; + } + + .progress-meter { + } + """ + + self.index_first = """ + + + BugsEverywhere Issue Tracker + + + + + + +
+

BugsEverywhere Bug List

+ + + + +

Active Bugs

Inactive Bugs

+ + + """ + + self.bug_line =""" + + + + + + + + """ + + self.detail_first = """ + + + BugsEverywhere Issue Tracker + + + + + + +
+

BugsEverywhere Bug List

+

Bug: _bug_id_

+
%s%s%s%s%s
+ + """ + + + + self.detail_line =""" + + + + """ + + self.index_last = """ + +
%s%s
+ +
+ + + + + + """ + + self.comment_section = """ + """ + + self.begin_comment_section =""" + + Comments: + + + """ + + + self.end_comment_section =""" + + + """ + + self.detail_last = """ + + + +

Back to Index

+ + + + """ + + + def create_index_file(self, out_dir_path, summary, bugs, ordered_bug, fileid): try: os.stat(out_dir_path) except: @@ -96,7 +457,7 @@ class BEHTMLGen(): raise cmdutil.UsageError, "Cannot create output directory." try: FO = open(out_dir_path+"/style.css", "w") - FO.write(css_file) + FO.write(self.css_file) FO.close() except: raise cmdutil.UsageError, "Cannot create the style.css file." @@ -107,15 +468,18 @@ class BEHTMLGen(): pass try: - FO = open(out_dir_path+"/index.html", "w") + if fileid == "active": + FO = open(out_dir_path+"/index.html", "w") + if fileid == "inactive": + FO = open(out_dir_path+"/index_inactive.html", "w") except: raise cmdutil.UsageError, "Cannot create the index.html file." - FO.write(index_first) + FO.write(self.index_first) c = 0 t = len(bugs) - 1 for l in range(t, -1, -1): - line = bug_line%(bugs[l].status, + line = self.bug_line%(bugs[l].status, bugs[l].uuid, bugs[l].uuid[0:3], bugs[l].uuid, bugs[l].status, bugs[l].uuid, bugs[l].severity, @@ -124,11 +488,11 @@ class BEHTMLGen(): ) FO.write(line) c += 1 - self.CreateDetailFile(bugs[l], out_dir_path) - FO.write(index_last) + self.CreateDetailFile(bugs[l], out_dir_path, fileid) + FO.write(self.index_last) - def CreateDetailFile(self, bug, out_dir_path): + def CreateDetailFile(self, bug, out_dir_path, fileid): f = "%s.html"%bug.uuid p = out_dir_path+"/bugs/"+f try: @@ -136,26 +500,67 @@ class BEHTMLGen(): except: raise cmdutil.UsageError, "Cannot create the detail html file." - detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], detail_first) + detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], self.detail_first) FD.write(detail_first_) - bug_ = self.bd.bug_from_shortname(bug.uuid[0:3]) + bug_ = self.bd.bug_from_shortname(bug.uuid) bug_.load_comments(load_full=True) + + FD.write(self.detail_line%("ID : ", bug.uuid)) + FD.write(self.detail_line%("Short name : ", bug.uuid[0:3])) + FD.write(self.detail_line%("Severity : ", bug.severity)) + FD.write(self.detail_line%("Status : ", bug.status)) + FD.write(self.detail_line%("Assigned : ", bug.assigned)) + FD.write(self.detail_line%("Target : ", bug.target)) + FD.write(self.detail_line%("Reporter : ", bug.reporter)) + FD.write(self.detail_line%("Creator : ", bug.creator)) + FD.write(self.detail_line%("Created : ", bug.time_string)) + FD.write(self.detail_line%("Summary : ", bug.summary)) + FD.write("
") + FD.write(self.begin_comment_section) + tr = [] + b = '' + level = 0 for i in bug_.comments(): - print i.uuid, i.in_reply_to - - FD.write(detail_line%("ID : ", bug.uuid)) - FD.write(detail_line%("Short name : ", bug.uuid[0:3])) - FD.write(detail_line%("Severity : ", bug.severity)) - FD.write(detail_line%("Status : ", bug.status)) - FD.write(detail_line%("Assigned : ", bug.assigned)) - FD.write(detail_line%("Target : ", bug.target)) - FD.write(detail_line%("Reporter : ", bug.reporter)) - FD.write(detail_line%("Creator : ", bug.creator)) - FD.write(detail_line%("Created : ", bug.time_string)) - FD.write(detail_line%("Summary : ", bug.summary)) - FD.write("") - FD.write(detail_last) - FD.close() \ No newline at end of file + if not isinstance(i.in_reply_to,str): + first = True + a = i.string_thread(flatten=False) + d = re.split('\n',a) + for x in range(0,len(d)): + hr = "" + if re.match(" *--------- Comment ---------",d[x]): + com = """ + %s
+ %s
+ %s
+ %s
+ %s
+ """%(d[x+1],d[x+2],d[x+3],d[x+4],d[x+5]) + l = re.sub("--------- Comment ---------", "", d[x]) + ll = l.split(" ") + la = l + ba = "" + if len(la) > level: + FD.write("
") + if len(la) < level: + FD.write("
") + if len(la) == 0: + if not first : + FD.write("") + first = False + FD.write("
") + level = len(la) + x += 5 + FD.write(com) + FD.write("
") + FD.write("
") + FD.write(self.end_comment_section) + if fileid == "active": + FD.write(self.detail_last%"../index.html") + if fileid == "inactive": + FD.write(self.detail_last%"../index_inactive.html") + FD.close() + + \ No newline at end of file -- cgit From 7208dc596d99d00aab46cc5b08f56994d7b40c05 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Fri, 31 Jul 2009 23:54:05 +0200 Subject: Closed bug f77, minox fix to layout --- becommands/html.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 3f6d923..eed7e56 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -118,8 +118,8 @@ class BEHTMLGen(): .commentF { padding: 0px; margin: auto; - padding-top: 20px; - paddin-bottom: 40px; + padding-top: 0px; + paddin-bottom: 20px; margin-top: 0; } @@ -502,9 +502,7 @@ class BEHTMLGen(): detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], self.detail_first) FD.write(detail_first_) - - - + bug_ = self.bd.bug_from_shortname(bug.uuid) bug_.load_comments(load_full=True) @@ -553,8 +551,8 @@ class BEHTMLGen(): FD.write("
") level = len(la) x += 5 + FD.write("--------- Comment ---------

") FD.write(com) - FD.write("


") FD.write("
") FD.write(self.end_comment_section) if fileid == "active": -- cgit From c200dda96479dfc1740efbeb14d08c56ba725264 Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Mon, 3 Aug 2009 21:29:21 +0200 Subject: Fixed width and index --- becommands/html.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index eed7e56..1ecf3ab 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -95,7 +95,7 @@ class BEHTMLGen(): body { font-family: "lucida grande", "sans serif"; color: #333; - width: 60em; + width: auto; margin: auto; } @@ -229,7 +229,7 @@ class BEHTMLGen(): margin-right: -20px; } - h2 { + wid { text-transform: uppercase; font-size: smaller; margin-top: 1em; @@ -395,6 +395,7 @@ class BEHTMLGen():

BugsEverywhere Bug List

+
Back to Index

Bug: _bug_id_

@@ -414,7 +415,7 @@ class BEHTMLGen(): - + @@ -440,7 +441,7 @@ class BEHTMLGen():
-

Back to Index

+
Back to Index
@@ -489,7 +490,8 @@ class BEHTMLGen(): FO.write(line) c += 1 self.CreateDetailFile(bugs[l], out_dir_path, fileid) - FO.write(self.index_last) + when = time.ctime() + FO.write(self.index_last%when) def CreateDetailFile(self, bug, out_dir_path, fileid): @@ -501,7 +503,12 @@ class BEHTMLGen(): raise cmdutil.UsageError, "Cannot create the detail html file." detail_first_ = re.sub('_bug_id_', bug.uuid[0:3], self.detail_first) - FD.write(detail_first_) + if fileid == "active": + FD.write(detail_first_%"../index.html") + if fileid == "inactive": + FD.write(detail_first_%"../index_inactive.html") + + bug_ = self.bd.bug_from_shortname(bug.uuid) bug_.load_comments(load_full=True) -- cgit From e42729af0efc1a4c064e8875e728f9c3c1694a1d Mon Sep 17 00:00:00 2001 From: Gianluca Montecchi Date: Tue, 4 Aug 2009 23:31:33 +0200 Subject: - closed bugs f77, 2b8 d8d - some changes to the css and to the html layout --- becommands/html.py | 127 ++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 61 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 1ecf3ab..4835227 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -38,14 +38,16 @@ def execute(args, test=False): """ parser = get_parser() options, args = parser.parse_args(args) + complete(options, args, parser) cmdutil.default_complete(options, args, parser, bugid_args={0: lambda bug : bug.active==False}) + if len(args) == 0: - out_dir = './html_export' - print "Creating the html output in ./html_export" + out_dir = options.outdir + print "Creating the html output in %s"%out_dir else: out_dir = args[0] - if len(args) > 1: + if len(args) > 0: raise cmdutil.UsageError, "Too many arguments." bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) @@ -76,6 +78,8 @@ def execute(args, test=False): def get_parser(): parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") + parser.add_option("-o", "--output", metavar="export_dir", dest="outdir", + help="Set the output path, default is ./html_export", default="html_export") return parser longhelp=""" @@ -84,7 +88,12 @@ Generate a set of html pages. def help(): return get_parser().help_str() + longhelp - + +def complete(options, args, parser): + for option, value in cmdutil.option_value_pairs(options, parser): + if "--complete" in args: + raise cmdutil.GetCompletions() # no positional arguments for list + class BEHTMLGen(): def __init__(self, bd): @@ -127,43 +136,32 @@ class BEHTMLGen(): border = 1; } - .open-row { - background-color: #e9e9e2; - width: 5%; - } - - .assigned-row { - background-color: #f9f9f9; - width: 5%; + .wishlist-row { + background-color: #B4FF9B; + width: auto; } - - .test-row { - background-color: #f9f9f9; - width: 5%; + .minor-row { + background-color: #FCFF98; + width: auto; } - .unconfirmed-row { - background-color: #f9f9f9; - width: 5%; - } - .fixed-row { - background-color: #f9f9f9; - width: 5%; + .serious-row { + background-color: #FFB648; + width: auto; } - .closed-row { - background-color: #f9f9f9; - width: 5%; + .critical-row { + background-color: #FF752A; + width: auto; } - .wontfix-row { - background-color: #f9f9f9; - width: 5%; + .fatal-row { + background-color: #FF3300; + width: auto; } - - + .person { font-family: courier; } @@ -187,7 +185,7 @@ class BEHTMLGen(): } p { - width: 40em; + width: auto; } .inline-status-image { @@ -200,23 +198,40 @@ class BEHTMLGen(): } table { - border-style: none; + border-style: 10px solid #313131; border-spacing: 0; + width: auto; } table.log { } - td { border-width: 0; border-style: none; padding-right: 0.5em; padding-left: 0.5em; + width: auto; + } + + .td_sel { + background-color: #afafaf; + border: 1px solid #afafaf; + font-weight:bold; + padding-right: 1em; + padding-left: 1em; + + } + + .td_nsel { + border: 0px; + padding-right: 1em; + padding-left: 1em; } tr { vertical-align: top; + width: auto; } h1 { @@ -240,8 +255,6 @@ class BEHTMLGen(): color: #305275; } - - .attrname { text-align: right; font-size: smaller; @@ -308,13 +321,6 @@ class BEHTMLGen(): background-color: #f9f9f9; } - .backptr { - font-size: smaller; - width: 100%; - text-align: left; - padding-bottom: 1em; - margin-top: 0; - } .logcomment { padding-left: 4em; @@ -325,21 +331,14 @@ class BEHTMLGen(): font-family: courier; } - .description { - background: #f2f2f2; - padding-left: 1em; - padding-right: 1em; - padding-top: 0.5em; - padding-bottom: 0.5em; + .table_bug { + background-color: #afafaf; + border: 2px solid #afafaf; } .message { } - .littledate { - font-size: smaller; - } - .progress-meter-done { background-color: #03af00; } @@ -350,6 +349,7 @@ class BEHTMLGen(): .progress-meter { } + """ self.index_first = """ @@ -364,12 +364,16 @@ class BEHTMLGen():

BugsEverywhere Bug List

- - - +

+

Active Bugs

Inactive Bugs

+ + + + +
Active BugsInactive Bugs
- +
""" @@ -471,16 +475,17 @@ class BEHTMLGen(): try: if fileid == "active": FO = open(out_dir_path+"/index.html", "w") + FO.write(self.index_first%('td_sel','td_nsel')) if fileid == "inactive": FO = open(out_dir_path+"/index_inactive.html", "w") + FO.write(self.index_first%('td_nsel','td_sel')) except: raise cmdutil.UsageError, "Cannot create the index.html file." - FO.write(self.index_first) c = 0 t = len(bugs) - 1 for l in range(t, -1, -1): - line = self.bug_line%(bugs[l].status, + line = self.bug_line%(bugs[l].severity, bugs[l].uuid, bugs[l].uuid[0:3], bugs[l].uuid, bugs[l].status, bugs[l].uuid, bugs[l].severity, @@ -489,12 +494,12 @@ class BEHTMLGen(): ) FO.write(line) c += 1 - self.CreateDetailFile(bugs[l], out_dir_path, fileid) + self.create_detail_file(bugs[l], out_dir_path, fileid) when = time.ctime() FO.write(self.index_last%when) - def CreateDetailFile(self, bug, out_dir_path, fileid): + def create_detail_file(self, bug, out_dir_path, fileid): f = "%s.html"%bug.uuid p = out_dir_path+"/bugs/"+f try: -- cgit From d5d2362b59a3b9851e10c0549e437fb3bce6222c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 11:52:39 -0400 Subject: Adjusted help/doc strings in becommands/html.py --- becommands/html.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 4835227..7640cf6 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -"""Re-open a bug""" +"""Generate a static HTML dump of the current repository status""" from libbe import cmdutil, bugdir, bug #from html_data import * import os, re, time, string @@ -83,7 +83,8 @@ def get_parser(): return parser longhelp=""" -Generate a set of html pages. +Generate a set of html pages representing the current state of the bug +directory. """ def help(): @@ -573,4 +574,4 @@ class BEHTMLGen(): FD.write(self.detail_last%"../index_inactive.html") FD.close() - \ No newline at end of file + -- cgit From 0343bff04f62db4adba0e9bb3014fc1e252a064b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:04:46 -0400 Subject: Improved threaded comment handling. The previous method only grabbed first line of a comment. The new approach replaces the messy Comment->string->parse->html with Comment->html. Also replaced all open()s with codecs.open to allow for non-ASCII output. Alphabetized the non libbe imports while I was adding codecs. --- becommands/html.py | 74 +++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 43 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 7640cf6..ecbe1d0 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -20,7 +20,7 @@ """Generate a static HTML dump of the current repository status""" from libbe import cmdutil, bugdir, bug #from html_data import * -import os, re, time, string +import codecs, os, re, string, time __desc__ = __doc__ @@ -73,8 +73,8 @@ def execute(args, test=False): #open_bug_list = sorted([(value,key) for (key,value) in bugs.items()]) html_gen = BEHTMLGen(bd) - html_gen.create_index_file(out_dir, st, bugs_active, ordered_bug_list, "active") - html_gen.create_index_file(out_dir, st, bugs_inactive, ordered_bug_list, "inactive") + html_gen.create_index_file(out_dir, st, bugs_active, ordered_bug_list, "active", bd.encoding) + html_gen.create_index_file(out_dir, st, bugs_inactive, ordered_bug_list, "inactive", bd.encoding) def get_parser(): parser = cmdutil.CmdOptionParser("be open OUTPUT_DIR") @@ -453,7 +453,7 @@ class BEHTMLGen(): """ - def create_index_file(self, out_dir_path, summary, bugs, ordered_bug, fileid): + def create_index_file(self, out_dir_path, summary, bugs, ordered_bug, fileid, encoding): try: os.stat(out_dir_path) except: @@ -462,7 +462,7 @@ class BEHTMLGen(): except: raise cmdutil.UsageError, "Cannot create output directory." try: - FO = open(out_dir_path+"/style.css", "w") + FO = codecs.open(out_dir_path+"/style.css", "w", encoding) FO.write(self.css_file) FO.close() except: @@ -475,10 +475,10 @@ class BEHTMLGen(): try: if fileid == "active": - FO = open(out_dir_path+"/index.html", "w") + FO = codecs.open(out_dir_path+"/index.html", "w", encoding) FO.write(self.index_first%('td_sel','td_nsel')) if fileid == "inactive": - FO = open(out_dir_path+"/index_inactive.html", "w") + FO = codecs.open(out_dir_path+"/index_inactive.html", "w", encoding) FO.write(self.index_first%('td_nsel','td_sel')) except: raise cmdutil.UsageError, "Cannot create the index.html file." @@ -495,16 +495,16 @@ class BEHTMLGen(): ) FO.write(line) c += 1 - self.create_detail_file(bugs[l], out_dir_path, fileid) + self.create_detail_file(bugs[l], out_dir_path, fileid, encoding) when = time.ctime() FO.write(self.index_last%when) - def create_detail_file(self, bug, out_dir_path, fileid): + def create_detail_file(self, bug, out_dir_path, fileid, encoding): f = "%s.html"%bug.uuid p = out_dir_path+"/bugs/"+f try: - FD = open(p, "w") + FD = codecs.open(p, "w", encoding) except: raise cmdutil.UsageError, "Cannot create the detail html file." @@ -534,39 +534,27 @@ class BEHTMLGen(): tr = [] b = '' level = 0 - for i in bug_.comments(): - if not isinstance(i.in_reply_to,str): - first = True - a = i.string_thread(flatten=False) - d = re.split('\n',a) - for x in range(0,len(d)): - hr = "" - if re.match(" *--------- Comment ---------",d[x]): - com = """ - %s
- %s
- %s
- %s
- %s
- """%(d[x+1],d[x+2],d[x+3],d[x+4],d[x+5]) - l = re.sub("--------- Comment ---------", "", d[x]) - ll = l.split(" ") - la = l - ba = "" - if len(la) > level: - FD.write("
") - if len(la) < level: - FD.write("
") - if len(la) == 0: - if not first : - FD.write("") - first = False - FD.write("
") - level = len(la) - x += 5 - FD.write("--------- Comment ---------

") - FD.write(com) - FD.write("

") + stack = [] + 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("") # close non-parent
") + else: + FD.write("
") + FD.write("
\n".join(lines)+"
\n") + while len(stack) > 0: + stack.pop(-1) + FD.write("
") # close every remaining
BugsEverywhere Issue Tracker @@ -538,7 +540,7 @@ class BEHTMLGen(): 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("
") # close non-parent
\n".join(lines)+"
\n") while len(stack) > 0: stack.pop(-1) - FD.write("
") # close every remaining
Date: Fri, 7 Aug 2009 13:12:08 -0400 Subject: Respect bugdir's encoding in html generation --- becommands/html.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 841e181..7ec5ddf 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -359,7 +359,7 @@ class BEHTMLGen(): BugsEverywhere Issue Tracker - + @@ -371,14 +371,14 @@ class BEHTMLGen():
- - + +
Active BugsInactive BugsActive BugsInactive Bugs
- """ + """ % self.bd.encoding self.bug_line =""" @@ -394,7 +394,7 @@ class BEHTMLGen(): BugsEverywhere Issue Tracker - + @@ -402,11 +402,11 @@ class BEHTMLGen():

BugsEverywhere Bug List

-
Back to Index
+
Back to Index

Bug: _bug_id_

- """ + """ % self.bd.encoding -- cgit From e8d8f2c829ba4bd062c21a9f75f338ad7e0c5053 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:15:19 -0400 Subject: Added DOCTYPE to detail html as well --- becommands/html.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 7ec5ddf..60a0461 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -391,6 +391,8 @@ class BEHTMLGen(): """ self.detail_first = """ + BugsEverywhere Issue Tracker -- cgit From 9e2b59eb77c844576203d202939b837788f634a8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:19:58 -0400 Subject: Protect bug html from libbe.settings_object.EMPTY --- becommands/html.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index 60a0461..c44d9a6 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Generate a static HTML dump of the current repository status""" -from libbe import cmdutil, bugdir, bug +from libbe import cmdutil, bugdir, bug, settings_object #from html_data import * import codecs, os, re, string, time @@ -523,15 +523,19 @@ class BEHTMLGen(): bug_ = self.bd.bug_from_shortname(bug.uuid) bug_.load_comments(load_full=True) + def empty_protected_string(value): + if value == settings_object.EMPTY: + return "" + return value FD.write(self.detail_line%("ID : ", bug.uuid)) FD.write(self.detail_line%("Short name : ", bug.uuid[0:3])) - FD.write(self.detail_line%("Severity : ", bug.severity)) - FD.write(self.detail_line%("Status : ", bug.status)) - FD.write(self.detail_line%("Assigned : ", bug.assigned)) - FD.write(self.detail_line%("Target : ", bug.target)) - FD.write(self.detail_line%("Reporter : ", bug.reporter)) - FD.write(self.detail_line%("Creator : ", bug.creator)) - FD.write(self.detail_line%("Created : ", bug.time_string)) + FD.write(self.detail_line%("Severity : ", empty_protected_string(bug.severity))) + FD.write(self.detail_line%("Status : ", empty_protected_string(bug.status))) + FD.write(self.detail_line%("Assigned : ", empty_protected_string(bug.assigned))) + FD.write(self.detail_line%("Target : ", empty_protected_string(bug.target))) + FD.write(self.detail_line%("Reporter : ", empty_protected_string(bug.reporter))) + FD.write(self.detail_line%("Creator : ", empty_protected_string(bug.creator))) + FD.write(self.detail_line%("Created : ", empty_protected_string(bug.time_string))) FD.write(self.detail_line%("Summary : ", bug.summary)) FD.write("") FD.write(self.begin_comment_section) -- cgit From ece3d7d54fe4bd93a6116fdb53363e0b0ae9b987 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:21:47 -0400 Subject: XHTML attribute values should be strings. --- becommands/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index c44d9a6..a879e77 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -537,7 +537,7 @@ class BEHTMLGen(): FD.write(self.detail_line%("Creator : ", empty_protected_string(bug.creator))) FD.write(self.detail_line%("Created : ", empty_protected_string(bug.time_string))) FD.write(self.detail_line%("Summary : ", bug.summary)) - FD.write("") + FD.write("") FD.write(self.begin_comment_section) tr = [] b = '' -- cgit From dfff8f6f7913a9a7da9c5881c03137b2fd12f019 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:23:00 -0400 Subject: XHTML tags must be closed (e.g.
, not
) --- becommands/html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index a879e77..1aa6cdd 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -537,7 +537,7 @@ class BEHTMLGen(): FD.write(self.detail_line%("Creator : ", empty_protected_string(bug.creator))) FD.write(self.detail_line%("Created : ", empty_protected_string(bug.time_string))) FD.write(self.detail_line%("Summary : ", bug.summary)) - FD.write("
") + FD.write("") FD.write(self.begin_comment_section) tr = [] b = '' @@ -559,7 +559,7 @@ class BEHTMLGen(): FD.write("
") else: FD.write("
") - FD.write("
\n".join(lines)+"
\n") + FD.write("
\n".join(lines)+"
\n") while len(stack) > 0: stack.pop(-1) FD.write("
\n") # close every remaining
-
") FD.write(self.begin_comment_section) tr = [] @@ -551,10 +559,10 @@ class BEHTMLGen(): stack.append(comment) lines = ["--------- Comment ---------", "Name: %s" % comment.uuid, - "From: %s" % comment.From, - "Date: %s" % comment.time_string, + "From: %s" % escape(comment.From), + "Date: %s" % escape(comment.time_string), ""] - lines.extend(comment.body.splitlines()) + lines.extend(escape(comment.body).splitlines()) if depth == 0: FD.write("
") else: -- cgit From 1aa5df91caaea3c40de334da159ec9982419c39c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 7 Aug 2009 13:49:47 -0400 Subject: XHTML attribute values should be strings, and cellspacing not allowed in tr. --- becommands/html.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'becommands/html.py') diff --git a/becommands/html.py b/becommands/html.py index f0c67c6..8bc570d 100644 --- a/becommands/html.py +++ b/becommands/html.py @@ -383,17 +383,17 @@ class BEHTMLGen():





Comments: + Comments: """ @@ -490,13 +502,13 @@ class BEHTMLGen(): c = 0 t = len(bugs) - 1 for l in range(t, -1, -1): - line = self.bug_line%(bugs[l].severity, - bugs[l].uuid, bugs[l].uuid[0:3], - bugs[l].uuid, bugs[l].status, - bugs[l].uuid, bugs[l].severity, - bugs[l].uuid, bugs[l].summary, - bugs[l].uuid, bugs[l].time_string - ) + line = self.bug_line%(escape(bugs[l].severity), + escape(bugs[l].uuid), escape(bugs[l].uuid[0:3]), + escape(bugs[l].uuid), escape(bugs[l].status), + escape(bugs[l].uuid), escape(bugs[l].severity), + escape(bugs[l].uuid), escape(bugs[l].summary), + escape(bugs[l].uuid), escape(bugs[l].time_string) + ) FO.write(line) c += 1 self.create_detail_file(bugs[l], out_dir_path, fileid, encoding) @@ -523,20 +535,16 @@ class BEHTMLGen(): bug_ = self.bd.bug_from_shortname(bug.uuid) bug_.load_comments(load_full=True) - def empty_protected_string(value): - if value == settings_object.EMPTY: - return "" - return value FD.write(self.detail_line%("ID : ", bug.uuid)) - FD.write(self.detail_line%("Short name : ", bug.uuid[0:3])) - FD.write(self.detail_line%("Severity : ", empty_protected_string(bug.severity))) - FD.write(self.detail_line%("Status : ", empty_protected_string(bug.status))) - FD.write(self.detail_line%("Assigned : ", empty_protected_string(bug.assigned))) - FD.write(self.detail_line%("Target : ", empty_protected_string(bug.target))) - FD.write(self.detail_line%("Reporter : ", empty_protected_string(bug.reporter))) - FD.write(self.detail_line%("Creator : ", empty_protected_string(bug.creator))) - FD.write(self.detail_line%("Created : ", empty_protected_string(bug.time_string))) - FD.write(self.detail_line%("Summary : ", bug.summary)) + FD.write(self.detail_line%("Short name : ", escape(bug.uuid[0:3]))) + FD.write(self.detail_line%("Severity : ", escape(bug.severity))) + FD.write(self.detail_line%("Status : ", escape(bug.status))) + FD.write(self.detail_line%("Assigned : ", escape(bug.assigned))) + FD.write(self.detail_line%("Target : ", escape(bug.target))) + FD.write(self.detail_line%("Reporter : ", escape(bug.reporter))) + FD.write(self.detail_line%("Creator : ", escape(bug.creator))) + FD.write(self.detail_line%("Created : ", escape(bug.time_string))) + FD.write(self.detail_line%("Summary : ", escape(bug.summary))) FD.write("

- - + +
Active BugsInactive BugsActive BugsInactive Bugs
- +
""" % self.bd.encoding self.bug_line =""" - + @@ -554,7 +554,7 @@ class BEHTMLGen(): 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
") + FD.write('
') else: - FD.write("
") + FD.write('
') FD.write("
\n".join(lines)+"
\n") while len(stack) > 0: stack.pop(-1) - FD.write("
\n") # close every remaining
%s %s %s