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/03/28 17:57:41 UTC

[12/42] 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/04bc59fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/04bc59fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/04bc59fa

Branch: refs/heads/db/5453
Commit: 04bc59fabce17351c92aa5a1467c7462cfe182a0
Parents: cd82457
Author: Stefano Invernizzi <st...@apache.org>
Authored: Wed Jan 30 17:03:56 2013 +0100
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Mar 28 16:53:31 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/04bc59fa/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/04bc59fa/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