You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by st...@apache.org on 2013/01/30 18:28:03 UTC

[3/5] 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/faf06992
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/faf06992
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/faf06992

Branch: refs/heads/si/5453
Commit: faf0699210277d1e756007a21587ee74c4792ba8
Parents: 9d2fdb9
Author: Stefano Invernizzi <st...@apache.org>
Authored: Wed Jan 30 17:03:56 2013 +0100
Committer: Stefano Invernizzi <st...@apache.org>
Committed: Wed Jan 30 17:03:56 2013 +0100

----------------------------------------------------------------------
 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/faf06992/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 6e20719..fadf6a6 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -168,12 +168,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/faf06992/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index d3071a0..3ddb248 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