def _process(self): stats = CategoryStatistics(self._target).getStatistics() if stats is not None: stats = stats.copy() if request.accept_mimetypes.best_match(("application/json", "text/html")) == "application/json": if stats is None: stats = {"events": None, "contributions": None, "files": None, "updated": None} else: stats = dict(stats) if stats["updated"]: stats["updated"] = stats["updated"].isoformat() return jsonify(stats) else: if stats is not None: plots, values, updated = _process_stats(stats, root=self._target.isRoot()) else: plots = values = updated = None return WPCategoryStatistics.render_template( "category_statistics.html", self._target, cat=self._target, plots=plots, values=values, updated=updated, has_stats=(stats is not None), )
def _process(self): stats = CategoryStatistics(self._target).getStatistics() if stats is not None: stats = stats.copy() if request.accept_mimetypes.best_match(('application/json', 'text/html')) == 'application/json': if stats is None: stats = {'events': None, 'contributions': None, 'files': None, 'updated': None} else: stats = dict(stats) if stats['updated']: stats['updated'] = stats['updated'].isoformat() return jsonify(stats) else: if stats is not None: plots, values, updated = _process_stats(stats, root=self._target.isRoot()) else: plots = values = updated = None return WPCategoryStatistics.render_template('category_statistics.html', self._target, cat=self._target, plots=plots, values=values, updated=updated, has_stats=(stats is not None))
def run(self): from MaKaC.statistics import CategoryStatistics CategoryStatistics.updateStatistics(self._cat, self.getLogger())
def category_stats(category_id='0'): CategoryStatistics.updateStatistics(CategoryManager().getById(category_id), logger)
def run(self): CategoryStatistics.updateStatistics(self._cat)
def run( self ): CategoryStatistics.updateStatistics(self._cat)