You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/04/04 20:37:28 UTC
[26/50] [abbrv] git commit: [5453] Implemented loop to load other
listeners updating stats
[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/4a38f1c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4a38f1c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4a38f1c7
Branch: refs/heads/db/5453
Commit: 4a38f1c78650c4c9951e776e0359906d35c0f19d
Parents: 2215a9a
Author: Stefano Invernizzi <st...@apache.org>
Authored: Wed Jan 30 17:03:56 2013 +0100
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Apr 3 21:45:14 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/4a38f1c7/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/4a38f1c7/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 7d2bbe0..68821e4 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -128,7 +128,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