web/application.py
changeset 9030 c1d5e8ca15ea
parent 9019 e08f9c55dab5
child 9031 6ff29f2879da
equal deleted inserted replaced
9029:5941cde49878 9030:c1d5e8ca15ea
   251 
   251 
   252     .. automethod:: cubicweb.web.application.CubicWebPublisher.main_handle_request
   252     .. automethod:: cubicweb.web.application.CubicWebPublisher.main_handle_request
   253     """
   253     """
   254 
   254 
   255     def __init__(self, config,
   255     def __init__(self, config,
   256                  session_handler_fact=CookieSessionHandler,
   256                  session_handler_fact=CookieSessionHandler):
   257                  vreg=None):
       
   258         self.info('starting web instance from %s', config.apphome)
   257         self.info('starting web instance from %s', config.apphome)
   259         if vreg is None:
       
   260             vreg = cwvreg.CWRegistryStore(config)
       
   261         self.vreg = vreg
       
   262         # connect to the repository and get instance's schema
   258         # connect to the repository and get instance's schema
   263         self.repo = config.repository(vreg)
   259         self.repo = config.repository()
       
   260         vreg = self.vreg = self.repo.vreg
   264         if not vreg.initialized:
   261         if not vreg.initialized:
   265             config.init_cubes(self.repo.get_cubes())
   262             config.init_cubes(self.repo.get_cubes())
   266             vreg.init_properties(self.repo.properties())
   263             vreg.init_properties(self.repo.properties())
   267             vreg.set_schema(self.repo.get_schema())
   264             vreg.set_schema(self.repo.get_schema())
   268         # set the correct publish method
   265         # set the correct publish method