diff --git a/AnkiServer/apps/rest_app.py b/AnkiServer/apps/rest_app.py index 71e9f6c..0fc8061 100644 --- a/AnkiServer/apps/rest_app.py +++ b/AnkiServer/apps/rest_app.py @@ -499,8 +499,11 @@ class CollectionHandler(RestHandlerBase): def stats_report(self, col, req): import anki.stats + import re stats = anki.stats.CollectionStats(col) + stats.width = int(req.data.get('width', 600)) + stats.height = int(req.data.get('height', 200)) reports = req.data.get('reports', self.stats_reports_order) include_css = req.data.get('include_css', False) include_jquery = req.data.get('include_jquery', False) @@ -508,7 +511,7 @@ class CollectionHandler(RestHandlerBase): if include_css: from anki.statsbg import bg - html = stats.css() % bg + html = stats.css % bg else: html = '' @@ -516,11 +519,14 @@ class CollectionHandler(RestHandlerBase): if not self.stats_reports.has_key(name): raise HTTPBadRequest("Unknown report name: %s" % name) func = getattr(stats, self.stats_reports[name]) - html = html + func() + + html += '