[Erp5-report] r7412 - /erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon May 22 17:44:14 CEST 2006


Author: chris
Date: Mon May 22 17:44:10 2006
New Revision: 7412

URL: http://svn.erp5.org?rev=7412&view=rev
Log:
- moved copytree function to another file for copyright concern.

Modified:
    erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py

Modified: erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py?rev=7412&r1=7411&r2=7412&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py (original)
+++ erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py Mon May 22 17:44:10 2006
@@ -43,13 +43,13 @@
 from OFS.Image import manage_addFile
 from cStringIO import StringIO
 from tempfile import mktemp
-from shutil import copy
 from Products.CMFCore.utils import getToolByName
 from Products.ERP5.Document.BusinessTemplate import removeAll
 from Products.ERP5.Document.BusinessTemplate import TemplateConditionError
 from xml.sax.saxutils import escape
 from dircache import listdir
 from OFS.Traversable import NotFound
+from Products.ERP5Type.copyTree import copytree
 
 try:
   from base64 import b64encode, b64decode
@@ -135,39 +135,6 @@
   """The base exception class when business template is unknown.
   """
   pass
-      
-def copytree(src, dst, symlinks=False):
-  """Recursively copy a directory tree using copy().
-
-  If exception(s) occur, an Error is raised with a list of reasons.
-  dst dir must exist
-
-  If the optional symlinks flag is true, symbolic links in the
-  source tree result in symbolic links in the destination tree; if
-  it is false, the contents of the files pointed to by symbolic
-  links are copied.
-  
-  Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved
-  """
-  names = listdir(src)
-  errors = []
-  for name in names:
-    srcname = os.path.join(src, name)
-    dstname = os.path.join(dst, name)
-    try:
-      if symlinks and os.path.islink(srcname):
-        linkto = os.readlink(srcname)
-        os.symlink(linkto, dstname)
-      elif os.path.isdir(srcname):
-        if not os.path.exists(dstname):
-          os.makedirs(dstname)
-        copytree(srcname, dstname, symlinks)
-      else:
-        copy(srcname, dstname)
-    except (IOError, os.error), why:
-      errors.append((srcname, dstname, 'Error: ' + str(why.strerror)))
-  if errors:
-    raise Error, errors
     
 def cacheWalk(top, topdown=True, onerror=None):
   """Directory tree generator.




More information about the Erp5-report mailing list