merge
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 10 Mar 2009 11:47:40 +0100
changeset 1029 2f984d7a5f8a
parent 1028 829a82bd7c44 (current diff)
parent 1023 278f997aa257 (diff)
child 1030 2ead2111cfab
merge
--- a/__init__.py	Mon Mar 09 18:53:10 2009 +0100
+++ b/__init__.py	Tue Mar 10 11:47:40 2009 +0100
@@ -2,9 +2,9 @@
 relations between entitites.
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
-:license: General Public License version 2 - http://www.gnu.org/licenses
+:license: Library General Public License version - http://www.gnu.org/licenses
 """
 __docformat__ = "restructuredtext en"
 from cubicweb.__pkginfo__ import version as __version__
--- a/cwconfig.py	Mon Mar 09 18:53:10 2009 +0100
+++ b/cwconfig.py	Tue Mar 10 11:47:40 2009 +0100
@@ -353,8 +353,9 @@
     @classmethod
     def cls_adjust_sys_path(cls):
         """update python path if necessary"""
-        if not cls.CUBES_DIR in sys.path:
-            sys.path.insert(0, cls.CUBES_DIR)
+        cubes_parent_dir = normpath(join(cls.CUBES_DIR, '..'))
+        if not cubes_parent_dir in sys.path:
+            sys.path.insert(0, cubes_parent_dir)
         try:
             import cubes
             cubes.__path__ = cls.cubes_search_path()
--- a/test/unittest_cwconfig.py	Mon Mar 09 18:53:10 2009 +0100
+++ b/test/unittest_cwconfig.py	Tue Mar 10 11:47:40 2009 +0100
@@ -73,6 +73,9 @@
                            'email/entities.py', 'email/views', 'email/hooks.py'])
 
     def test_cubes_path(self):
+        # make sure we don't import the email cube, but the stdlib email package
+        import email
+        self.assertNotEquals(dirname(email.__file__), self.config.CUBES_DIR)
         os.environ['CW_CUBES_PATH'] = join(dirname(__file__), 'data', 'cubes')
         self.assertEquals(self.config.cubes_search_path(),
                           [abspath(join(dirname(__file__), 'data', 'cubes')),