You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/03/05 23:42:11 UTC
[30/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/4da896ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4da896ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4da896ea
Branch: refs/heads/si/5453
Commit: 4da896eae0c695a544fc902c87cda415b0c5e878
Parents: 27e1f31
Author: Stefano Invernizzi <st...@apache.org>
Authored: Wed Jan 30 17:03:56 2013 +0100
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Mar 5 21:39:30 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/4da896ea/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/4da896ea/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