unittestleri seviyoruz. iki tane daha bug temizledik..

sevgili paket geliştiricisi arkadaşlar, lütfen shelltools.copy kullandığınızda paketlerin içeriğinin doğru olup olmadığını test etmeyi ihmal etmeyiniz.

 python'un standart library'si içerisindeki copy gerçekten çok kötü. actionsapi içerisinde mükemmele yaklaşıyoruz, fakat test etmemiz gerekli.
This commit is contained in:
A. Murat Eren
2006-03-10 12:40:11 +00:00
parent 49cb3b3aee
commit 047c5476f2
+10 -3
View File
@@ -138,7 +138,10 @@ def copy(source, destination, sym = True):
os.remove(destination)
os.symlink(os.readlink(filePath), destination)
elif isLink(filePath) and not sym:
shutil.copy(os.readlink(filePath), destination)
if isDirectory(os.readlink(filePath)):
copytree(os.readlink(filePath), destination)
else:
shutil.copy(os.readlink(filePath), destination)
elif isDirectory(filePath):
copytree(filePath, destination, sym)
else:
@@ -148,8 +151,12 @@ def copytree(source, destination, sym = True):
'''recursively copy an entire directory tree rooted at source'''
if isDirectory(source):
if os.path.exists(destination):
copytree(source, join_path(destination, os.path.basename(source)))
return
if isDirectory(destination):
copytree(source, join_path(destination, os.path.basename(source.strip('/'))))
return
else:
copytree(source, join_path(destination, os.path.basename(source)))
return
try:
shutil.copytree(source, destination, sym)
except OSError, e: