Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E738DC85 for ; Mon, 5 Nov 2012 16:33:00 +0000 (UTC) Received: (qmail 74195 invoked by uid 500); 5 Nov 2012 16:33:00 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 74134 invoked by uid 500); 5 Nov 2012 16:32:59 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 74098 invoked by uid 99); 5 Nov 2012 16:32:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 16:32:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BFDD64409E; Mon, 5 Nov 2012 16:32:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: [#5229] add activitystream.recording.enabled option Message-Id: <20121105163257.BFDD64409E@tyr.zones.apache.org> Date: Mon, 5 Nov 2012 16:32:57 +0000 (UTC) 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 Authored: Mon Nov 5 16:30:18 2012 +0000 Committer: Dave Brondsema 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