Kaydet (Commit) fdd2269f authored tarafından Jack Jansen's avatar Jack Jansen

Allow lists of files/fsspecs as the source for copy() and move(). By

Bill Bedford, slightly edited by me.
üst f58a7aaf
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment