Log message for revision 41399:
  
        - Collector #2002: fixed broken 'ls -R' functionality (didn't
          recurse properly subclasses of OFS.Folder)
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt   2006-01-21 14:55:38 UTC (rev 41398)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-01-21 15:19:11 UTC (rev 41399)
@@ -22,7 +22,7 @@
 
    - Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
-  after 2.9.0 
+  after 2.9.0
 
     Bugs fixed
 
@@ -35,6 +35,9 @@
       - Replaced used of deprecated 'OFS.content_types' module with cognates
         from 'zope.app.content_types'.
 
+      - Collector #2002: fixed broken 'ls -R' functionality (didn't
+        recurse properly subclasses of OFS.Folder)
+
   Zope 2.9.0 (2006/01/09)
 
     Bugs fixed

Modified: Zope/branches/2.9/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2006-01-21 14:55:38 UTC 
(rev 41398)
+++ Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2006-01-21 15:19:11 UTC 
(rev 41399)
@@ -524,7 +524,7 @@
             obj_ids.sort()
             for id in obj_ids:
                 o=self._getOb(id)
-                if hasattr(o, 'isPrincipiaFolderish') and \
+                if hasattr(aq_base(o), 'isPrincipiaFolderish') and \
                    o.isPrincipiaFolderish:
                     r.append(o)
         return r
@@ -641,7 +641,7 @@
                 break
             ob=ob.aq_parent
 
-        files=self.objectItems()
+        files = list(self.objectItems())
 
         # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -649,15 +649,10 @@
 
             all_files = copy.copy(files)
             for f in files:
-                if f[1].meta_type == "Folder":
+                if hasattr(aq_base(f[1]), 'isPrincipiaFolderish') and 
f[1].isPrincipiaFolderish:
                     all_files.extend(findChildren(f[1]))
-                else:
-                    all_files.append(f)
-
             files = all_files
 
-        files = list(files)
-
         # Perform globbing on list of files (ajung)
 
         globbing = REQUEST.environ.get('GLOBBING','')
@@ -735,12 +730,12 @@
     find all children of an object (ajung)
     """
 
-    lst =[]
-    for name,child in obj.objectItems():
-        if child.meta_type=="Folder":
-            lst.extend(findChildren(child,dirname+ obj.id + '/'))
+    lst = []
+    for name, child in obj.objectItems():
+        if hasattr(aq_base(child), 'isPrincipiaFolderish') and 
child.isPrincipiaFolderish:
+            lst.extend(findChildren(child, dirname + obj.id + '/'))
         else:
-            lst.append( (dirname + obj.id + "/" + name,child) )
+            lst.append((dirname + obj.id + "/" + name, child))
 
     return lst
 

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to