[cwconfig] impose an order on appobject paths processing: entities first (closes #2330799) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 27 Apr 2012 14:10:04 +0200
branchstable
changeset 8377 a9a7ae11dfb0
parent 8375 7d8979176bc0
child 8378 76ce456f8f07
child 8379 1a3746ec4d65
[cwconfig] impose an order on appobject paths processing: entities first (closes #2330799)
cwconfig.py
--- a/cwconfig.py	Tue Apr 24 10:31:46 2012 +0200
+++ b/cwconfig.py	Fri Apr 27 14:10:04 2012 +0200
@@ -700,7 +700,9 @@
         vregpath = []
         if evobjpath is None:
             evobjpath = cls.cubicweb_appobject_path
-        for subdir in evobjpath:
+        # NOTE: for the order, see http://www.cubicweb.org/ticket/2330799
+        #       it is clearly a workaround
+        for subdir in sorted(evobjpath, key=lambda x:x != 'entities'):
             path = join(CW_SOFTWARE_ROOT, subdir)
             if exists(path):
                 vregpath.append(path)
@@ -712,7 +714,8 @@
         if tvobjpath is None:
             tvobjpath = cls.cube_appobject_path
         for directory in templpath:
-            for subdir in tvobjpath:
+            # NOTE: for the order, see http://www.cubicweb.org/ticket/2330799
+            for subdir in sorted(tvobjpath, key=lambda x:x != 'entities'):
                 path = join(directory, subdir)
                 if exists(path):
                     vregpath.append(path)