Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA6EFE568 for ; Mon, 25 Feb 2013 21:56:17 +0000 (UTC) Received: (qmail 16335 invoked by uid 500); 25 Feb 2013 21:56:17 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 16273 invoked by uid 500); 25 Feb 2013 21:56:17 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 16202 invoked by uid 99); 25 Feb 2013 21:56:17 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 21:56:17 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4B8D660E0; Mon, 25 Feb 2013 21:56:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [42/50] [abbrv] git commit: [5453] Implemented loop to load other listeners updating stats Message-Id: <20130225215617.4B8D660E0@tyr.zones.apache.org> Date: Mon, 25 Feb 2013 21:56:17 +0000 (UTC) [5453] Implemented loop to load other listeners updating stats Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/beaa737f Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/beaa737f Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/beaa737f Branch: refs/heads/si/5453 Commit: beaa737fe7dcdf84947f4d1ff9e926beeaa755a7 Parents: f033116 Author: Stefano Invernizzi Authored: Wed Jan 30 17:03:56 2013 +0100 Committer: Tim Van Steenburgh Committed: Mon Feb 25 20:20:56 2013 +0000 ---------------------------------------------------------------------- Allura/allura/lib/app_globals.py | 8 ++++---- Allura/development.ini | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/beaa737f/Allura/allura/lib/app_globals.py ---------------------------------------------------------------------- diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py index 71426a6..632a29f 100644 --- a/Allura/allura/lib/app_globals.py +++ b/Allura/allura/lib/app_globals.py @@ -172,12 +172,12 @@ class Globals(object): # Zarkov logger self._zarkov = None - self.show_userstats = config.get('user.stats.enable','false')=='true' + self.show_userstats = config.get('userstats.enable','false')=='true' # Set listeners to update stats statslisteners = [] - ep = self.entry_points['stats'].get('userstats') - if self.show_userstats and ep: - statslisteners.append(ep().listener) + for name, ep in self.entry_points['stats'].iteritems(): + if config.get('%s.enable' % name,'false')=='true': + statslisteners.append(ep().listener) self.statsUpdater = PostEvent(statslisteners) @LazyProperty http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/beaa737f/Allura/development.ini ---------------------------------------------------------------------- diff --git a/Allura/development.ini b/Allura/development.ini index 61ae275..6d88b95 100644 --- a/Allura/development.ini +++ b/Allura/development.ini @@ -125,7 +125,9 @@ trovecategories.enableediting = true # If set to false, the stats of the user are not # updated and they are not shown to users. -user.stats.enable = true +# Note: the name of the parameter has to be the same +# of the entry point, followed by .enable +userstats.enable = true # ActivityStream activitystream.master = mongodb://127.0.0.1:27017