# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
# All rights reserved.
#
-# $Id:$
+# $Id$
#
# Author: Lorenzo Berni <duplo@develer.com>
#
import fnmatch
from shutil import *
+del copytree
+
def copytree(src, dst, symlinks=False, ignore_list=[]):
"""
Reimplementation of the shutil.copytree function that use ignore_list.
try:
ignored = False
for ignore in ignore_list:
- if fnmatch.fnmatch(srcname, ignore):
+ if fnmatch.fnmatch(name, ignore):
ignored = True
break
if ignored:
linkto = os.readlink(srcname)
os.symlink(linkto, dstname)
elif os.path.isdir(srcname):
- copytree(srcname, dstname, symlinks)
+ copytree(srcname, dstname, symlinks, ignore_list)
else:
copy2(srcname, dstname)
# XXX What about devices, sockets etc.?