# HG changeset patch # User Sylvain Thénault # Date 1347278526 -7200 # Node ID d32ab8570e5d3993e5f2185cc5f0767aa360bf47 # Parent 00597256de1837cbbda2f47991df9a5bc3b6994b [repo initialisation] during repo creation, load all hooks and entities code this simplify code and make it more consistent diff -r 00597256de18 -r d32ab8570e5d server/__init__.py --- a/server/__init__.py Mon Sep 10 13:53:59 2012 +0200 +++ b/server/__init__.py Mon Sep 10 14:02:06 2012 +0200 @@ -224,10 +224,6 @@ config._cubes = None # avoid assertion error repo, cnx = in_memory_repo_cnx(config, login, password=pwd) repo.system_source.eid = ssource.eid # redo this manually - # trigger vreg initialisation of entity classes - config.cubicweb_appobject_path = set(('entities',)) - config.cube_appobject_path = set(('entities',)) - repo.vreg.set_schema(repo.schema) assert len(repo.sources) == 1, repo.sources handler = config.migration_handler(schema, interactive=False, cnx=cnx, repo=repo) diff -r 00597256de18 -r d32ab8570e5d server/repository.py --- a/server/repository.py Mon Sep 10 13:53:59 2012 +0200 +++ b/server/repository.py Mon Sep 10 14:02:06 2012 +0200 @@ -207,16 +207,10 @@ elif config.creating: # repository creation config.bootstrap_cubes() - self.set_schema(config.load_schema(), resetvreg=False) - # need to load the Any and CWUser entity types - etdirectory = join(CW_SOFTWARE_ROOT, 'entities') - self.vreg.init_registration([etdirectory]) - for modname in ('__init__', 'authobjs', 'wfobjs'): - self.vreg.load_file(join(etdirectory, '%s.py' % modname), - 'cubicweb.entities.%s' % modname) - hooksdirectory = join(CW_SOFTWARE_ROOT, 'hooks') - self.vreg.load_file(join(hooksdirectory, 'metadata.py'), - 'cubicweb.hooks.metadata') + # trigger vreg initialisation of entity classes + config.cubicweb_appobject_path = set(('hooks', 'entities')) + config.cube_appobject_path = set(('hooks', 'entities')) + self.set_schema(config.load_schema()) elif config.read_instance_schema: # normal start: load the instance schema from the database self.fill_schema()