incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#5229] add activitystream.recording.enabled option
Date Mon, 05 Nov 2012 16:32:57 GMT
Updated Branches:
  refs/heads/db/5229 [created] b35c51397


[#5229] add activitystream.recording.enabled option


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b35c5139
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b35c5139
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b35c5139

Branch: refs/heads/db/5229
Commit: b35c51397f72d318899782f291a6c23857351f64
Parents: f5c8e37
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Mon Nov 5 16:30:18 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Mon Nov 5 16:30:36 2012 +0000

----------------------------------------------------------------------
 Allura/allura/config/middleware.py |    3 ++-
 Allura/allura/lib/app_globals.py   |   16 +++++++++++++++-
 Allura/development.ini             |    1 +
 ForgeActivity/test.ini             |    2 ++
 4 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b35c5139/Allura/allura/config/middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/middleware.py b/Allura/allura/config/middleware.py
index 2cbadd3..24064fb 100644
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -73,7 +73,8 @@ def _make_core_app(root, global_conf, full_stack=True, **app_conf):
     ming.configure(**app_conf)
 
     # Configure ActivityStream
-    activitystream.configure(**app_conf)
+    if asbool(app_conf.get('activitystream.recording.enabled', False)):
+        activitystream.configure(**app_conf)
 
     # Configure EW variable provider
     ew.render.TemplateEngine.register_variable_provider(get_tg_vars)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b35c5139/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 00af5ae..6cf7f14 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -165,7 +165,21 @@ class Globals(object):
     @LazyProperty
     def director(self):
         """Return activitystream director"""
-        return activitystream.director()
+        if asbool(config.get('activitystream.recording.enabled', False)):
+            return activitystream.director()
+        else:
+            class NullActivityStreamDirector(object):
+                def connect(self, *a, **kw):
+                    pass
+                def disconnect(self, *a, **kw):
+                    pass
+                def is_connected(self, *a, **kw):
+                    return False
+                def create_activity(self, *a, **kw):
+                    pass
+                def get_timeline(self, *a, **kw):
+                    return []
+            return NullActivityStreamDirector()
 
     @LazyProperty
     def amq_conn(self):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b35c5139/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index a38ad7d..4ba35d7 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -128,6 +128,7 @@ activitystream.activity_collection = activities
 activitystream.node_collection = nodes
 activitystream.timeline_collection = timelines
 activitystream.enabled = false
+activitystream.recording.enabled = false
 
 # Ming setup
 # These don't necessarily have to be separate databases, they could

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b35c5139/ForgeActivity/test.ini
----------------------------------------------------------------------
diff --git a/ForgeActivity/test.ini b/ForgeActivity/test.ini
index a4d598d..2bd928b 100644
--- a/ForgeActivity/test.ini
+++ b/ForgeActivity/test.ini
@@ -14,6 +14,8 @@ port = 5000
 [app:main]
 use = config:../Allura/test.ini
 
+activitystream.recording.enabled = true
+
 [app:main_without_authn]
 use = config:../Allura/test.ini#main_without_authn
 


Mime
View raw message