[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #2002: fixed broken 'ls -R' functionality (didn't

Sidnei da Silva sidnei at enfoldsystems.com
Sat Jan 21 09:14:12 EST 2006


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

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2006-01-21 12:16:22 UTC (rev 41392)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2006-01-21 14:14:12 UTC (rev 41393)
@@ -30,6 +30,8 @@
       - Collector #1999: fixed broken FTP rename functionality
         (RNFR now returns 350 as status code instead 250)
 
+      - Collector #2002: fixed broken 'ls -R' functionality (didn't
+        recurse properly subclasses of OFS.Folder)
 
   Zope 2.8.5 (2005/12/19)
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py	2006-01-21 12:16:22 UTC (rev 41392)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/ObjectManager.py	2006-01-21 14:14:12 UTC (rev 41393)
@@ -514,7 +514,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
@@ -629,7 +629,7 @@
                 break
             ob=ob.aq_parent
 
-        files=self.objectItems()
+        files = list(self.objectItems())
 
         # recursive ride through all subfolders (ls -R) (ajung)
 
@@ -637,15 +637,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','')
@@ -723,12 +718,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
 



More information about the Zope-Checkins mailing list