no need for lib_directory
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 07 Aug 2009 14:06:58 +0200
changeset 2735 39c942241b48
parent 2734 3f183182d581
child 2736 c5048502409f
no need for lib_directory
goa/dbmyams.py
schema.py
--- a/goa/dbmyams.py	Fri Aug 07 14:00:54 2009 +0200
+++ b/goa/dbmyams.py	Fri Aug 07 14:06:58 2009 +0200
@@ -168,7 +168,6 @@
     for compname in config['included-cubes']:
         __import__('%s.schema' % compname)
     loader = GaeSchemaLoader(use_gauthservice=config['use-google-auth'], db=db)
-    loader.lib_directory = join(CW_SOFTWARE_ROOT, 'schemas')
     if schemaclasses is not None:
         for cls in schemaclasses:
             loader.load_dbmodel(cls.__name__, goadb.extract_dbmodel(cls))
--- a/schema.py	Fri Aug 07 14:00:54 2009 +0200
+++ b/schema.py	Fri Aug 07 14:06:58 2009 +0200
@@ -850,13 +850,12 @@
         """return a Schema instance from the schema definition read
         from <directory>
         """
-        self.lib_directory = join(cubicweb.CW_SOFTWARE_ROOT, 'schemas')
         return super(BootstrapSchemaLoader, self).load(
             path, config.appid, register_base_types=False, **kwargs)
 
     def _load_definition_files(self, cubes=None):
         # bootstraping, ignore cubes
-        filepath = join(self.lib_directory, 'bootstrap.py')
+        filepath = join(cubicweb.CW_SOFTWARE_ROOT, 'schemas', 'bootstrap.py')
         self.info('loading %s', filepath)
         self.handle_file(filepath)
 
@@ -883,13 +882,13 @@
             return super(CubicWebSchemaLoader, self).load(config, path=path, **kwargs)
         finally:
             # we've to cleanup modules imported from cubicweb.schemas as well
-            cleanup_sys_modules([self.lib_directory])
+            cleanup_sys_modules([join(cubicweb.CW_SOFTWARE_ROOT, 'schemas')])
 
     def _load_definition_files(self, cubes):
-        for filepath in (join(self.lib_directory, 'bootstrap.py'),
-                         join(self.lib_directory, 'base.py'),
-                         join(self.lib_directory, 'workflow.py'),
-                         join(self.lib_directory, 'Bookmark.py')):
+        for filepath in (join(CW_SOFTWARE_ROOT, 'schemas', 'bootstrap.py'),
+                         join(CW_SOFTWARE_ROOT, 'schemas', 'base.py'),
+                         join(CW_SOFTWARE_ROOT, 'schemas', 'workflow.py'),
+                         join(CW_SOFTWARE_ROOT, 'schemas', 'Bookmark.py')):
             self.info('loading %s', filepath)
             self.handle_file(filepath)
         for cube in cubes: