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 --- .../4ddf1313-bb3c-45d3-8dca-79ed5830d606/values | 17 + .../8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values | 17 + .../9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values | 17 + .../c271a802-d324-48a6-b01d-63e4a72aa43e/values | 17 + .../d8dba78d-f82a-4674-9003-a0ec569b4a96/values | 17 + becommands/html.py | 107 ++++++ becommands/html_data.py | 395 +++++++++++++++++++++ 7 files changed, 587 insertions(+) create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values create mode 100644 .be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values create mode 100644 .be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values create mode 100644 .be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values create mode 100644 .be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values create mode 100644 becommands/html.py create mode 100644 becommands/html_data.py diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values new file mode 100644 index 0000000..95b83ee --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: minor + + +status: open + + +summary: Bug di test + + +time: Fri, 03 Jul 2009 20:19:36 +0000 + diff --git a/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values b/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values new file mode 100644 index 0000000..e7284bc --- /dev/null +++ b/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: minor + + +status: open + + +summary: Add the html files for the status detail + + +time: Fri, 03 Jul 2009 22:56:09 +0000 + diff --git a/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values b/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values new file mode 100644 index 0000000..900a347 --- /dev/null +++ b/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: minor + + +status: open + + +summary: Add the html files for the severity detail + + +time: Fri, 03 Jul 2009 22:56:19 +0000 + diff --git a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values new file mode 100644 index 0000000..03ebb00 --- /dev/null +++ b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: minor + + +status: open + + +summary: Add a verbose option? + + +time: Fri, 03 Jul 2009 21:17:41 +0000 + diff --git a/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values b/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values new file mode 100644 index 0000000..dc96c5b --- /dev/null +++ b/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: wishlist + + +status: open + + +summary: Add the possibility to specify the repository Directory ? + + +time: Fri, 03 Jul 2009 21:18:13 +0000 + 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 diff --git a/becommands/html_data.py b/becommands/html_data.py new file mode 100644 index 0000000..db3d1c0 --- /dev/null +++ b/becommands/html_data.py @@ -0,0 +1,395 @@ + +__desc__ = __doc__ + +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; +} + + +.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; + +} + + +.even-row { +background-color: #e9e9e2; +} + +.odd-row { +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 { +} +""" + +html_index = """ + + +BugsEverywhere Issue Tracker + + + + + + +
+

BugsEverywhere Issue Tracker

+ + + + + + + +
+

Issues list by status

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ unconfirmed + + _unconfirmed_ + + issues +
+ open + + _open_ + + issues +
+ assigned + + _assigned_ + + issues +
+ test + + _test_ + + issues +
+ closed + + _closed_ + + issues +
+ fixed + + _fixed_ + + issues +
+ wontfix + + _wontfix_ + + issues +
+ disabled + + _disabled_ + + issues +
+
+ +

Open issues by severity

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ serious + + _serious_ + + issues +
+ critical + + _critical_ + + issues +
+ fatal + + _fatal_ + + issues +
+ wishlist + + _wishlist_ + + issues +
+ minor + + _minor_ + + issues +
+
+ +
+ + + + + + +""" + -- 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 --- .../2b81b428-fc43-4970-9469-b442385b9c0d/values | 17 ++++ becommands/html.py | 95 ++++++++++++++-------- becommands/html_data.py | 20 ++++- 3 files changed, 98 insertions(+), 34 deletions(-) create mode 100644 .be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values diff --git a/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values b/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values new file mode 100644 index 0000000..ef6644a --- /dev/null +++ b/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values @@ -0,0 +1,17 @@ +creator: gianluca + + +reporter: gianluca + + +severity: minor + + +status: open + + +summary: Use the get_parser + + +time: Wed, 08 Jul 2009 21:27:37 +0000 + 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." + diff --git a/becommands/html_data.py b/becommands/html_data.py index db3d1c0..f72eb3a 100644 --- a/becommands/html_data.py +++ b/becommands/html_data.py @@ -317,9 +317,10 @@ html_index = """ + -

Open issues by severity

+

Issues list by severity

@@ -380,6 +381,18 @@ html_index = """
+ + +

Last 10 Open bugs

+ + + +_LAST_ACTVITY_ + + +
+ + @@ -393,3 +406,8 @@ html_index = """ """ +last_activity = """ + + _BUG_ on _DATE_ + +""" -- cgit From f33d0625cdd8caad858e6ab8b0df3cede051733e Mon Sep 17 00:00:00 2001 From: gianluca Date: Fri, 10 Jul 2009 00:56:48 +0200 Subject: Changed the index layout --- becommands/html_data.py | 184 +++++++----------------------------------------- 1 file changed, 24 insertions(+), 160 deletions(-) diff --git a/becommands/html_data.py b/becommands/html_data.py index f72eb3a..460daa8 100644 --- a/becommands/html_data.py +++ b/becommands/html_data.py @@ -155,11 +155,11 @@ padding-left: 0.5em; } -.even-row { +.selected-cell { background-color: #e9e9e2; } -.odd-row { +.plain-cell { background-color: #f9f9f9; } @@ -218,187 +218,51 @@ html_index = """
-

BugsEverywhere Issue Tracker

+

BugsEverywhere Bug List

- - - -
-

Issues list by status

- +

Bugs summary divided by status

+
- - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- unconfirmed +
+ _unconfirmed_ unconfirmed - _unconfirmed_ + + _open_ open - issues + + _assigned_ assigned
- open - - _open_ - - issues -
- assigned - - _assigned_ - - issues -
- test - - _test_ - - issues -
- closed - - _closed_ - - issues + + _test_ test
- fixed - - _fixed_ - - issues -
- wontfix - - _wontfix_ + + _closed_ closed - issues -
- disabled + + _fixed_ fixed - _disabled_ + + _wontfix_ wontfix - issues + + _disabled_ disabled
- -

Issues list by severity

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- serious - - _serious_ - - issues -
- critical - - _critical_ - - issues -
- fatal - - _fatal_ - - issues -
- wishlist - - _wishlist_ - - issues -
- minor - - _minor_ - - issues -
-
- -

Last 10 Open bugs

- - - -_LAST_ACTVITY_ - - -
-
+

Showing all bugs

+ -- 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 +++++++++++++++++++++++++++++-------------------- becommands/html_data.py | 69 +++++++++++++++++-------------------------- 2 files changed, 72 insertions(+), 75 deletions(-) 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 diff --git a/becommands/html_data.py b/becommands/html_data.py index 460daa8..f9c966a 100644 --- a/becommands/html_data.py +++ b/becommands/html_data.py @@ -18,6 +18,16 @@ margin-top: 1em; background-color: #fcfcfc; } +.even-row { +background-color: #e9e9e2; +width: 5%; +} + +.odd-row { + +background-color: #f9f9f9; +width: 5%; +} .person { font-family: courier; @@ -207,7 +217,7 @@ background-color: #ddd; } """ -html_index = """ +index_first = """ BugsEverywhere Issue Tracker @@ -219,59 +229,32 @@ html_index = """

BugsEverywhere Bug List

- +

Open Bugs

+
- - +""" + +bug_line =""" + + + + + + +""" + +index_last = """
-

Bugs summary divided by status

- - - - - - - - - - - - - -
- _unconfirmed_ unconfirmed - - _open_ open - - _assigned_ assigned - - _test_ test - - _closed_ closed - - _fixed_ fixed - - _wontfix_ wontfix - - _disabled_ disabled -
-
_bug_id__status__sev__descr__time_
-

Showing all bugs

+

Show all bugs

- """ -last_activity = """ - - _BUG_ on _DATE_ - -""" -- 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 --- .../f776d667-6959-4cab-b05d-39e07702c04b/body | 1 + .../f776d667-6959-4cab-b05d-39e07702c04b/values | 8 +++ .../4ddf1313-bb3c-45d3-8dca-79ed5830d606/values | 5 +- becommands/html.py | 51 +++++++------ becommands/html_data.py | 84 +++++++++++++++++++--- 5 files changed, 118 insertions(+), 31 deletions(-) create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/values diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/body new file mode 100644 index 0000000..184fdad --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/body @@ -0,0 +1 @@ +Commento di test diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/values new file mode 100644 index 0000000..dd1fd4b --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/f776d667-6959-4cab-b05d-39e07702c04b/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Mon, 20 Jul 2009 21:54:57 +0000 + + +From: Gianluca Montecchi + diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values index 95b83ee..ba1e385 100644 --- a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/values @@ -1,3 +1,6 @@ +assigned: Gianluca Montecchi + + creator: gianluca @@ -7,7 +10,7 @@ reporter: gianluca severity: minor -status: open +status: assigned summary: Bug di test 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 diff --git a/becommands/html_data.py b/becommands/html_data.py index f9c966a..68445cd 100644 --- a/becommands/html_data.py +++ b/becommands/html_data.py @@ -18,17 +18,47 @@ margin-top: 1em; background-color: #fcfcfc; } -.even-row { +tb { +border = 1; +} + +.open-row { background-color: #e9e9e2; width: 5%; } -.odd-row { +.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; } @@ -235,15 +265,40 @@ index_first = """ """ bug_line =""" - - _bug_id_ - _status_ - _sev_ - _descr_ - _time_ + +%s +%s +%s +%s +%s """ + +detail_first = """ + + +BugsEverywhere Issue Tracker + + + + + + +
+

BugsEverywhere Bug List

+

Bug: _bug_id_

+ + +""" + + +detail_line =""" + + + +""" + index_last = """
%s%s
@@ -258,3 +313,16 @@ index_last = """ """ +detail_last = """ + + + +
+ +

Back to Index

+ + + + + +""" \ 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 --- .../comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/body | 1 + .../3e83dd98-d421-43b6-a78c-5da7aac5f279/values | 11 +++++++++++ .../comments/433e2090-55d6-4b13-bc6d-0b509556f21b/body | 1 + .../433e2090-55d6-4b13-bc6d-0b509556f21b/values | 11 +++++++++++ .../comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/body | 1 + .../a0cbbd2e-a078-41ac-b583-900e9bb2abf3/values | 11 +++++++++++ .be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values | 2 +- .be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values | 2 +- .be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values | 17 +++++++++++++++++ becommands/html.py | 18 +++++++++++------- 10 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/values create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/values create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/values create mode 100644 .be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/body new file mode 100644 index 0000000..b8a6cb9 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/body @@ -0,0 +1 @@ +Reply 1-bis diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/values new file mode 100644 index 0000000..062b638 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/3e83dd98-d421-43b6-a78c-5da7aac5f279/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Tue, 21 Jul 2009 21:33:37 +0000 + + +From: Gianluca Montecchi + + +In-reply-to: f776d667-6959-4cab-b05d-39e07702c04b + diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/body new file mode 100644 index 0000000..1e25ab8 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/body @@ -0,0 +1 @@ +Reply 1 diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/values new file mode 100644 index 0000000..f335ced --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/433e2090-55d6-4b13-bc6d-0b509556f21b/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Tue, 21 Jul 2009 21:33:29 +0000 + + +From: Gianluca Montecchi + + +In-reply-to: a0cbbd2e-a078-41ac-b583-900e9bb2abf3 + diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/body new file mode 100644 index 0000000..c8e09f8 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/body @@ -0,0 +1 @@ +Reply diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/values new file mode 100644 index 0000000..06691af --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/a0cbbd2e-a078-41ac-b583-900e9bb2abf3/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Tue, 21 Jul 2009 21:31:21 +0000 + + +From: Gianluca Montecchi + + +In-reply-to: f776d667-6959-4cab-b05d-39e07702c04b + diff --git a/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values b/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values index e7284bc..918f6be 100644 --- a/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values +++ b/.be/bugs/8385a1fb-63df-4ca6-81cd-28ede83bb0c2/values @@ -7,7 +7,7 @@ reporter: gianluca severity: minor -status: open +status: wontfix summary: Add the html files for the status detail diff --git a/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values b/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values index 900a347..600f2c3 100644 --- a/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values +++ b/.be/bugs/9b1a0e71-4f7d-40b1-ab32-18496bf19a3f/values @@ -7,7 +7,7 @@ reporter: gianluca severity: minor -status: open +status: wontfix summary: Add the html files for the severity detail diff --git a/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values b/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values new file mode 100644 index 0000000..d585297 --- /dev/null +++ b/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values @@ -0,0 +1,17 @@ +creator: Gianluca Montecchi + + +reporter: Gianluca Montecchi + + +severity: minor + + +status: open + + +summary: Comment should be threaded in the html output + + +time: Tue, 21 Jul 2009 21:39:52 +0000 + 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 --- .../b1a772a0-241f-42fc-8209-765162485b0a/body | 1 + .../b1a772a0-241f-42fc-8209-765162485b0a/values | 8 + .../c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/body | 1 + .../c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/values | 11 + .../d74a6a82-6a08-472b-86d8-b1546c4d460f/body | 1 + .../d74a6a82-6a08-472b-86d8-b1546c4d460f/values | 8 + becommands/html.py | 465 +++++++++++++++++++-- becommands/html_data.py | 328 --------------- 8 files changed, 465 insertions(+), 358 deletions(-) create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/values create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/values create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/values delete mode 100644 becommands/html_data.py diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/body new file mode 100644 index 0000000..2e6c9cb --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/body @@ -0,0 +1 @@ +commento \n su due righe diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/values new file mode 100644 index 0000000..b6abe1f --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/b1a772a0-241f-42fc-8209-765162485b0a/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Wed, 22 Jul 2009 21:48:23 +0000 + + +From: Gianluca Montecchi + diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/body new file mode 100644 index 0000000..6db3446 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/body @@ -0,0 +1 @@ +Identato diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/values new file mode 100644 index 0000000..2b282c0 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/c1b9bc11-71e1-473e-ad9c-cfba0a2533d5/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Mon, 27 Jul 2009 20:08:02 +0000 + + +From: Gianluca Montecchi + + +In-reply-to: d74a6a82-6a08-472b-86d8-b1546c4d460f + diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/body new file mode 100644 index 0000000..bea1060 --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/body @@ -0,0 +1 @@ +Commento normale diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/values new file mode 100644 index 0000000..e26b88e --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/d74a6a82-6a08-472b-86d8-b1546c4d460f/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Wed, 22 Jul 2009 20:05:15 +0000 + + +From: Gianluca Montecchi + 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 diff --git a/becommands/html_data.py b/becommands/html_data.py deleted file mode 100644 index 68445cd..0000000 --- a/becommands/html_data.py +++ /dev/null @@ -1,328 +0,0 @@ - -__desc__ = __doc__ - -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; -} - -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 { -} -""" - -index_first = """ - - -BugsEverywhere Issue Tracker - - - - - - -
-

BugsEverywhere Bug List

-

Open Bugs

- - -""" - -bug_line =""" - - - - - - - -""" - -detail_first = """ - - -BugsEverywhere Issue Tracker - - - - - - -
-

BugsEverywhere Bug List

-

Bug: _bug_id_

-
%s%s%s%s%s
- -""" - - - -detail_line =""" - - - -""" - -index_last = """ - -
%s%s
- -
- -

Show all bugs

- - - - - -""" - -detail_last = """ - - - - - -

Back to Index

- - - - - -""" \ 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 --- .be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values | 2 +- becommands/html.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values b/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values index d585297..5a7261b 100644 --- a/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values +++ b/.be/bugs/f77fc673-c852-4c81-bfa2-1d59de2661c8/values @@ -7,7 +7,7 @@ reporter: Gianluca Montecchi severity: minor -status: open +status: fixed summary: Comment should be threaded in the html output 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(-) 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 --- .../2b81b428-fc43-4970-9469-b442385b9c0d/values | 2 +- .../9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/body | 1 + .../9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/values | 11 ++ .../c271a802-d324-48a6-b01d-63e4a72aa43e/values | 2 +- .../d8dba78d-f82a-4674-9003-a0ec569b4a96/values | 2 +- .../da2b09ff-af24-40f3-9b8d-6ffaa5f41164/values | 17 +++ becommands/html.py | 127 +++++++++++---------- 7 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/body create mode 100644 .be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/values create mode 100644 .be/bugs/da2b09ff-af24-40f3-9b8d-6ffaa5f41164/values diff --git a/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values b/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values index ef6644a..0a47ab5 100644 --- a/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values +++ b/.be/bugs/2b81b428-fc43-4970-9469-b442385b9c0d/values @@ -7,7 +7,7 @@ reporter: gianluca severity: minor -status: open +status: closed summary: Use the get_parser diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/body b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/body new file mode 100644 index 0000000..df57a1a --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/body @@ -0,0 +1 @@ +prova diff --git a/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/values b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/values new file mode 100644 index 0000000..b2249ff --- /dev/null +++ b/.be/bugs/4ddf1313-bb3c-45d3-8dca-79ed5830d606/comments/9d56f097-bf5b-4d8a-a83e-7ade8afd2b4c/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Tue, 04 Aug 2009 19:48:58 +0000 + + +From: Gianluca Montecchi + + +In-reply-to: 433e2090-55d6-4b13-bc6d-0b509556f21b + diff --git a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values index 03ebb00..8b58566 100644 --- a/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values +++ b/.be/bugs/c271a802-d324-48a6-b01d-63e4a72aa43e/values @@ -4,7 +4,7 @@ creator: gianluca reporter: gianluca -severity: minor +severity: wishlist status: open diff --git a/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values b/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values index dc96c5b..a5777b9 100644 --- a/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values +++ b/.be/bugs/d8dba78d-f82a-4674-9003-a0ec569b4a96/values @@ -7,7 +7,7 @@ reporter: gianluca severity: wishlist -status: open +status: closed summary: Add the possibility to specify the repository Directory ? diff --git a/.be/bugs/da2b09ff-af24-40f3-9b8d-6ffaa5f41164/values b/.be/bugs/da2b09ff-af24-40f3-9b8d-6ffaa5f41164/values new file mode 100644 index 0000000..4d784ad --- /dev/null +++ b/.be/bugs/da2b09ff-af24-40f3-9b8d-6ffaa5f41164/values @@ -0,0 +1,17 @@ +creator: Gianluca Montecchi + + +reporter: Gianluca Montecchi + + +severity: wishlist + + +status: open + + +summary: Add an icon near the status string + + +time: Tue, 04 Aug 2009 21:15:52 +0000 + 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(-) 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(-) 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
\n") # close non-parent
\n") # close every remaining
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(+) 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(-) 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(-) 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(-) 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
") 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(-) 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():





- - + +
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