cmdutil.default_complete(options, args, parser,
bugid_args={0: lambda bug : bug.active==False})
+
if len(args) == 0:
out_dir = options.outdir
- print "Creating the html output in %s"%out_dir
+ css_file = options.css_file
+ if css_file == None:
+ _css_file = "default"
+ else:
+ _css_file = css_file
+ print "Creating the html output in %s using %s style"%(out_dir, _css_file)
else:
out_dir = args[0]
if len(args) > 0:
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 = BEHTMLGen(bd, css_file)
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")
parser.add_option("-o", "--output", metavar="export_dir", dest="outdir",
- help="Set the output path, default is ./html_export", default="html_export")
+ help="Set the output path, default is ./html_export", default="html_export")
+ parser.add_option("-s", "--css-file", metavar="css_file", dest="css_file",
+ help="Use a different css file, default is empty", default=None)
return parser
longhelp="""
return "".join(chars)
class BEHTMLGen():
- def __init__(self, bd):
+ def __init__(self, bd, template):
self.index_value = ""
self.bd = bd
-
+
self.css_file = """
body {
font-family: "lucida grande", "sans serif";
<div class="footer">Generated by <a href="http://www.bugseverywhere.org/">BugsEverywhere</a>.</div>
</body>
</html>
- """
+ """
+ if template != None:
+ FO = open(template)
+ newCss = FO.read()
+ FO.close()
+ self.css_file = newCss
def create_index_file(self, out_dir_path, summary, bugs, ordered_bug, fileid, encoding):
try: