dbapi.py
changeset 2476 1294a6bdf3bf
parent 2266 efc6de279644
child 2496 fbd1fd2ca312
equal deleted inserted replaced
2475:b6753521129d 2476:1294a6bdf3bf
    58                                   '(host: %s:%i)' % (nshost, nsport))
    58                                   '(host: %s:%i)' % (nshost, nsport))
    59         except NamingError:
    59         except NamingError:
    60             raise ConnectionError('Could not get repository for %s '
    60             raise ConnectionError('Could not get repository for %s '
    61                                   '(not registered in Pyro), '
    61                                   '(not registered in Pyro), '
    62                                   'you may have to restart your server-side '
    62                                   'you may have to restart your server-side '
    63                                   'application' % nsid)
    63                                   'instance' % nsid)
    64         return core.getProxyForURI(uri)
    64         return core.getProxyForURI(uri)
    65 
    65 
    66 def repo_connect(repo, login, password, cnxprops=None):
    66 def repo_connect(repo, login, password, cnxprops=None):
    67     """Constructor to create a new connection to the CubicWeb repository.
    67     """Constructor to create a new connection to the CubicWeb repository.
    68 
    68 
   420         if self._cnxtype == 'inmemory':
   420         if self._cnxtype == 'inmemory':
   421             # should reinit hooks manager as well
   421             # should reinit hooks manager as well
   422             hm, config = self._repo.hm, self._repo.config
   422             hm, config = self._repo.hm, self._repo.config
   423             hm.set_schema(hm.schema) # reset structure
   423             hm.set_schema(hm.schema) # reset structure
   424             hm.register_system_hooks(config)
   424             hm.register_system_hooks(config)
   425             # application specific hooks
   425             # instance specific hooks
   426             if self._repo.config.application_hooks:
   426             if self._repo.config.instance_hooks:
   427                 hm.register_hooks(config.load_hooks(self.vreg))
   427                 hm.register_hooks(config.load_hooks(self.vreg))
   428 
   428 
   429     def source_defs(self):
   429     def source_defs(self):
   430         """Return the definition of sources used by the repository.
   430         """Return the definition of sources used by the repository.
   431 
   431