server/__init__.py
changeset 8580 d753d6a6798f
parent 8561 77ea3eed9946
child 8626 e2ba137b2bf9
equal deleted inserted replaced
8579:c4673bc11053 8580:d753d6a6798f
   163     from cubicweb.server.sqlutils import sqlexec, sqlschema, sqldropschema
   163     from cubicweb.server.sqlutils import sqlexec, sqlschema, sqldropschema
   164     # configuration to avoid db schema loading and user'state checking
   164     # configuration to avoid db schema loading and user'state checking
   165     # on connection
   165     # on connection
   166     config.creating = True
   166     config.creating = True
   167     config.consider_user_state = False
   167     config.consider_user_state = False
       
   168     config.cubicweb_appobject_path = set(('hooks', 'entities'))
       
   169     config.cube_appobject_path = set(('hooks', 'entities'))
   168     # only enable the system source at initialization time
   170     # only enable the system source at initialization time
   169     repo = Repository(config, vreg=vreg)
   171     repo = Repository(config, vreg=vreg)
   170     schema = repo.schema
   172     schema = repo.schema
   171     sourcescfg = config.sources()
   173     sourcescfg = config.sources()
   172     source = sourcescfg['system']
   174     source = sourcescfg['system']
   240     cnx.close()
   242     cnx.close()
   241     repo.shutdown()
   243     repo.shutdown()
   242     # restore initial configuration
   244     # restore initial configuration
   243     config.creating = False
   245     config.creating = False
   244     config.consider_user_state = True
   246     config.consider_user_state = True
       
   247     # (drop instance attribute to get back to class attribute)
       
   248     del config.cubicweb_appobject_path
       
   249     del config.cube_appobject_path
   245     print '-> database for instance %s initialized.' % config.appid
   250     print '-> database for instance %s initialized.' % config.appid
   246 
   251 
   247 
   252 
   248 def initialize_schema(config, schema, mhandler, event='create'):
   253 def initialize_schema(config, schema, mhandler, event='create'):
   249     from cubicweb.server.schemaserial import serialize_schema
   254     from cubicweb.server.schemaserial import serialize_schema