From 72f6fbab4a882cb7f4ce08f8b2facaa116b2cbf3 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Wed, 20 Jan 2010 13:41:25 +0000
Subject: [PATCH] add a getter method for a single configuration property.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31838 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/interfaces/configurable.py | 4 ++++
 product/ERP5/mixin/configurable.py      | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/product/ERP5/interfaces/configurable.py b/product/ERP5/interfaces/configurable.py
index bea1407ef8..67047342b1 100644
--- a/product/ERP5/interfaces/configurable.py
+++ b/product/ERP5/interfaces/configurable.py
@@ -32,6 +32,10 @@ from zope.interface import Interface
 class IConfigurable(Interface):
   """
   """
+  def getConfigurationProperty(key):
+    """
+    """
+
   def getConfigurationPropertyIdList():
     """
     """
diff --git a/product/ERP5/mixin/configurable.py b/product/ERP5/mixin/configurable.py
index f5e2bd016b..b2de53ab82 100644
--- a/product/ERP5/mixin/configurable.py
+++ b/product/ERP5/mixin/configurable.py
@@ -48,6 +48,13 @@ class ConfigurableMixin:
   # Declarative interfaces
   zope.interface.implements(interfaces.IConfigurable,)
 
+  security.declareProtected(Permissions.AccessContentsInformation,
+                            'getConfigurationProperty')
+  def getConfigurationProperty(self, key, default=None):
+    """
+    """
+    return self._getConfigurationPropertyDict().get(key, default)
+
   security.declareProtected(Permissions.AccessContentsInformation,
                             'getConfigurationPropertyIdList')
   def getConfigurationPropertyIdList(self):
-- 
2.30.9