[Erp5-report] r29615 - /erp5/trunk/products/ERP5/ERP5Site.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 13 18:44:27 CEST 2009


Author: leonardo
Date: Tue Oct 13 18:44:26 2009
New Revision: 29615

URL: http://svn.erp5.org?rev=29615&view=rev
Log:
Brown-paper-bag commit. This is what happens when one pays more attention to CMF 1.5 compatibility than to CMF 2.x compatibility one is trying to achieve. Make the skin registration also work on CMF 2.x as well (approved by jerome)

Modified:
    erp5/trunk/products/ERP5/ERP5Site.py

Modified: erp5/trunk/products/ERP5/ERP5Site.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/ERP5Site.py?rev=29615&r1=29614&r2=29615&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/ERP5Site.py [utf8] (original)
+++ erp5/trunk/products/ERP5/ERP5Site.py [utf8] Tue Oct 13 18:44:26 2009
@@ -1703,12 +1703,14 @@
     from Products.CMFCore.DirectoryView import createDirectoryView
     try:
       from Products.CMFCore.DirectoryView import _generateKey
+      def generateKey(package, subdir):
+        return _generateKey(package.__name__, subdir)
     except ImportError:
       # Means we're still on CMF 1.x, were they generate the DirectoryView
       # key using minimalpath
       # ( see Products.CMFCore.DirectoryView.addDirectoryViews() )
       from Products.CMFCore.DirectoryView import minimalpath
-      def _generateKey(package, subdir):
+      def generateKey(package, subdir):
         package_path = os.path.dirname(package.__file__)
         return minimalpath(os.path.join(package_path, subdir))
     import Products.CMFDefault
@@ -1716,8 +1718,8 @@
     ps = getToolByName(p, 'portal_skins')
     # get the layer directories actually present
     for cmfdefault_skin_layer in self.CMFDEFAULT_FOLDER_LIST:
-      reg_key = _generateKey(Products.CMFDefault,
-                             'skins/' + cmfdefault_skin_layer)
+      reg_key = generateKey(Products.CMFDefault,
+                            'skins/' + cmfdefault_skin_layer)
       createDirectoryView(ps, reg_key)
 
   def setupDefaultSkins(self, p):




More information about the Erp5-report mailing list