repoapi.py
changeset 9459 d3016c08b4ae
parent 9458 e2dfdd313dfe
child 9469 032825bbacab
equal deleted inserted replaced
9458:e2dfdd313dfe 9459:d3016c08b4ae
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """Official API to access the content of a repository
    18 """Official API to access the content of a repository
    19 """
    19 """
    20 from warnings import warn
       
    21 
       
    22 from logilab.common.deprecation import deprecated
    20 from logilab.common.deprecation import deprecated
    23 
    21 
    24 from cubicweb.utils import parse_repo_uri
    22 from cubicweb.utils import parse_repo_uri
    25 from cubicweb import ConnectionError, ProgrammingError, AuthenticationError
    23 from cubicweb import ConnectionError, ProgrammingError, AuthenticationError
    26 from uuid import uuid4
    24 from uuid import uuid4
   237     def get_schema(self):
   235     def get_schema(self):
   238         """Return the schema currently used by the repository."""
   236         """Return the schema currently used by the repository."""
   239         return self._session.repo.source_defs()
   237         return self._session.repo.source_defs()
   240 
   238 
   241     @_open_only
   239     @_open_only
   242     def get_option_value(self, option, foreid=None):
   240     def get_option_value(self, option):
   243         """Return the value for `option` in the configuration. If `foreid` is
   241         """Return the value for `option` in the configuration."""
   244         specified, the actual repository to which this entity belongs is
   242         return self._session.repo.get_option_value(option)
   245         dereferenced and the option value retrieved from it.
       
   246         """
       
   247         if foreid is not None:
       
   248             warn('[3.19] foreid argument is deprecated', DeprecationWarning,
       
   249                  stacklevel=2)
       
   250         return self._session.repo.get_option_value(option, foreid)
       
   251 
   243 
   252     describe = _srv_cnx_func('describe')
   244     describe = _srv_cnx_func('describe')
   253 
   245 
   254     # undo support ############################################################
   246     # undo support ############################################################
   255 
   247