[repo] new method on repo+dbapi.Connection to get a value from repository's configuration
--- 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