aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'becommands/html.py')
-rw-r--r--becommands/html.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/becommands/html.py b/becommands/html.py
index 4bf43f4..3acf973 100644
--- a/becommands/html.py
+++ b/becommands/html.py
@@ -1,8 +1,4 @@
-# Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc.
-# Marien Zwart <marienz@gentoo.org>
-# Thomas Gerigk <tgerigk@gmx.de>
-# W. Trevor King <wking@drexel.edu>
-# <abentley@panoramicfeedback.com>
+# Copyright (C) 2005-2009
#
# 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
@@ -18,24 +14,33 @@
# 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, settings_object
+from libbe import cmdutil, bugdir, bug
#from html_data import *
import codecs, os, re, string, time
import xml.sax.saxutils, htmlentitydefs
__desc__ = __doc__
-def execute(args, test=False):
+def execute(args, manipulate_encodings=True):
"""
>>> import os
- >>> bd = bugdir.simple_bug_dir()
+ >>> bd = bugdir.SimpleBugDir()
>>> 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
+ >>> execute([], manipulate_encodings=False)
+ Creating the html output in html_export
+ >>> os.path.exists("./html_export")
+ True
+ >>> os.path.exists("./html_export/index.html")
+ True
+ >>> os.path.exists("./html_export/index_inactive.html")
+ True
+ >>> os.path.exists("./html_export/bugs")
+ True
+ >>> os.path.exists("./html_export/bugs/a.html")
+ True
+ >>> os.path.exists("./html_export/bugs/b.html")
+ True
+ >>> bd.cleanup()
"""
parser = get_parser()
options, args = parser.parse_args(args)
@@ -51,7 +56,8 @@ def execute(args, test=False):
if len(args) > 0:
raise cmdutil.UsageError, "Too many arguments."
- bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+ bd = bugdir.BugDir(from_disk=True,
+ manipulate_encodings=manipulate_encodings)
bd.load_all_bugs()
status_list = bug.status_values
severity_list = bug.severity_values
@@ -98,7 +104,7 @@ def complete(options, args, parser):
def escape(string):
- if string == settings_object.EMPTY:
+ if string == None:
return ""
chars = []
for char in xml.sax.saxutils.escape(string):