webserver: Added a simple webserver to serve a project's reports.

- e.g. sudo -H vigil-webserver my_project
  then see http://localhost:80
This commit is contained in:
Andrew Hamilton 2018-05-13 21:23:57 +10:00
parent 748f6f932b
commit 7cfbcae685
7 changed files with 303 additions and 5 deletions

View file

@ -771,6 +771,12 @@ class Result:
def appearance_min(self):
return [status_to_str(self.status)]
def as_html(self):
html, styles = termstr.TermStr(status_to_str(self.status)).as_html()
return ('<a title="%s" href="%s/%s">%s</a>' %
(self.tool.__name__, self.path, self.tool.__name__, html),
styles)
def generic_tools():
return [contents, metadata]