[repo] new method on repo+dbapi.Connection to get a value from repository's configuration stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 16 Sep 2010 11:28:25 +0200
branchstable
changeset 6257 7eb5f1aed728
parent 6256 da77d3f95079
child 6258 9b5c008267b0
[repo] new method on repo+dbapi.Connection to get a value from repository's configuration
dbapi.py
server/repository.py
--- a/dbapi.py	Thu Sep 16 11:27:50 2010 +0200
+++ b/dbapi.py	Thu Sep 16 11:28:25 2010 +0200
@@ -639,6 +639,11 @@
         return self._repo.get_schema()
 
     @check_not_closed
+    def get_option_value(self, option):
+        """return the value for `option` in the repository configuration."""
+        return self._repo.get_option_value(option)
+
+    @check_not_closed
     def describe(self, eid):
         return self._repo.describe(self.sessionid, eid, **self._txid())
 
--- a/server/repository.py	Thu Sep 16 11:27:50 2010 +0200
+++ b/server/repository.py	Thu Sep 16 11:28:25 2010 +0200
@@ -461,6 +461,14 @@
         cubes.remove('cubicweb')
         return cubes
 
+    def get_option_value(self, option):
+        """Return the value for `option` in the configuration.
+
+        This is a public method, not requiring a session id.
+        """
+        # XXX we may want to check we don't give sensible information
+        return self.config[option]
+
     @cached
     def get_versions(self, checkversions=False):
         """Return the a dictionary containing cubes used by this instance