server/__init__.py
changeset 9790 0872ac2a1db0
parent 9556 12ee310541bb
child 10024 2a08247b57fb
child 10026 621646d5f010
--- a/server/__init__.py	Thu Jun 12 17:50:50 2014 +0200
+++ b/server/__init__.py	Tue Apr 15 11:55:37 2014 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -197,7 +197,8 @@
                         {'u': user.eid, 'group': group})
     return user
 
-def init_repository(config, interactive=True, drop=False, vreg=None):
+def init_repository(config, interactive=True, drop=False, vreg=None,
+                    init_config=None):
     """initialise a repository database by creating tables add filling them
     with the minimal set of entities (ie at least the schema, base groups and
     a initial user)
@@ -215,6 +216,9 @@
     config.cube_appobject_path = set(('hooks', 'entities'))
     # only enable the system source at initialization time
     repo = Repository(config, vreg=vreg)
+    if init_config is not None:
+        # further config initialization once it has been bootstrapped
+        init_config(config)
     schema = repo.schema
     sourcescfg = config.read_sources_file()
     source = sourcescfg['system']