]> granicus.if.org Git - python/commitdiff
Allow lists of files/fsspecs as the source for copy() and move(). By
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 22 Sep 2000 12:17:14 +0000 (12:17 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 22 Sep 2000 12:17:14 +0000 (12:17 +0000)
Bill Bedford, slightly edited by me.

Mac/Lib/findertools.py

index 8a1bf44608638ee738e3bed87ce70e1e41c4fbbb..45f3e9e87977ed9a8602ce24090c46a9a7559da5 100644 (file)
@@ -32,14 +32,24 @@ def Print(file):
 def copy(src, dstdir):
        """Copy a file to a folder"""
        finder = _getfinder()
-       src_fss = macfs.FSSpec(src)
+       if type(src) == type([]):
+               src_fss = []
+               for s in src:
+                       src_fss.append(macfs.FSSpec(s))
+       else:
+               src_fss = macfs.FSSpec(src)
        dst_fss = macfs.FSSpec(dstdir)
        return finder.duplicate(src_fss, to=dst_fss)
 
 def move(src, dstdir):
        """Move a file to a folder"""
        finder = _getfinder()
-       src_fss = macfs.FSSpec(src)
+       if type(src) == type([]):
+               src_fss = []
+               for s in src:
+                       src_fss.append(macfs.FSSpec(s))
+       else:
+               src_fss = macfs.FSSpec(src)
        dst_fss = macfs.FSSpec(dstdir)
        return finder.move(src_fss, to=dst_fss)