diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-09-22 12:17:14 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-09-22 12:17:14 (GMT) |
commit | fdd2269fcc9ab9f6349e600a3cc29960cb3f8c39 (patch) | |
tree | c0162e8f3a1cd2e37859fddb55cec3b1a6be8206 /Mac/Lib | |
parent | f58a7aafea13f9214065bf5d97855cfce154d1c3 (diff) | |
download | cpython-fdd2269fcc9ab9f6349e600a3cc29960cb3f8c39.zip cpython-fdd2269fcc9ab9f6349e600a3cc29960cb3f8c39.tar.gz cpython-fdd2269fcc9ab9f6349e600a3cc29960cb3f8c39.tar.bz2 |
Allow lists of files/fsspecs as the source for copy() and move(). By
Bill Bedford, slightly edited by me.
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/findertools.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Mac/Lib/findertools.py b/Mac/Lib/findertools.py index 8a1bf44..45f3e9e8 100644 --- a/Mac/Lib/findertools.py +++ b/Mac/Lib/findertools.py @@ -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) |