server/repository.py
branchstable
changeset 6308 c151c730a1ac
parent 6257 7eb5f1aed728
child 6333 e3994fcc21c3
equal deleted inserted replaced
6307:c07763c59fcb 6308:c151c730a1ac
   459                                           or self.config.mode == 'test'))
   459                                           or self.config.mode == 'test'))
   460         cubes = list(versions)
   460         cubes = list(versions)
   461         cubes.remove('cubicweb')
   461         cubes.remove('cubicweb')
   462         return cubes
   462         return cubes
   463 
   463 
   464     def get_option_value(self, option):
   464     def get_option_value(self, option, foreid=None):
   465         """Return the value for `option` in the configuration.
   465         """Return the value for `option` in the configuration. If `foreid` is
       
   466         specified, the actual repository to which this entity belongs is
       
   467         derefenced and the option value retrieved from it.
   466 
   468 
   467         This is a public method, not requiring a session id.
   469         This is a public method, not requiring a session id.
   468         """
   470         """
   469         # XXX we may want to check we don't give sensible information
   471         # XXX we may want to check we don't give sensible information
   470         return self.config[option]
   472         if foreid is None:
       
   473             return self.config[option]
       
   474         _, sourceuri, extid = self.type_and_source_from_eid(foreid)
       
   475         if sourceuri == 'system':
       
   476             return self.config[option]
       
   477         pool = self._get_pool()
       
   478         try:
       
   479             return pool.connection(sourceuri).get_option_value(option, extid)
       
   480         finally:
       
   481             self._free_pool(pool)
   471 
   482 
   472     @cached
   483     @cached
   473     def get_versions(self, checkversions=False):
   484     def get_versions(self, checkversions=False):
   474         """Return the a dictionary containing cubes used by this instance
   485         """Return the a dictionary containing cubes used by this instance
   475         as key with their version as value, including cubicweb version.
   486         as key with their version as value, including cubicweb version.