X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/10138c15c015c3c0c3546e5083642cf2145dfe82..e1b8ff8941da1b8f1eda141d8ec41f03fa9f9cfc:/tools/crunchstat-summary/crunchstat_summary/webchart.py diff --git a/tools/crunchstat-summary/crunchstat_summary/webchart.py b/tools/crunchstat-summary/crunchstat_summary/webchart.py index 790b08da87..8adf0fee7e 100644 --- a/tools/crunchstat-summary/crunchstat_summary/webchart.py +++ b/tools/crunchstat-summary/crunchstat_summary/webchart.py @@ -2,7 +2,11 @@ # # SPDX-License-Identifier: AGPL-3.0 -import cgi +try: + from html import escape +except ImportError: + from cgi import escape + import json import pkg_resources @@ -10,7 +14,7 @@ import pkg_resources class WebChart(object): """Base class for a web chart. - Subclasses must assign JSLIB and JSASSET, and override the + Subclasses must assign JSLIB and JSASSETS, and override the chartdata() method. """ JSLIB = None @@ -20,20 +24,29 @@ class WebChart(object): self.label = label self.summarizers = summarizers - def html(self): + def html(self, bodytext=''): return '''