From c7843df04e6f07e6293bfc7460ddd7fbe2bc701e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 2 Nov 2015 16:18:50 +0530 Subject: [PATCH] recursively copy files function implemented --- ee/core/fileutils.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py index 8a4f5d83..b5369050 100644 --- a/ee/core/fileutils.py +++ b/ee/core/fileutils.py @@ -62,11 +62,34 @@ class EEFileUtils(): Log.debug(self, "{0}".format(e)) Log.error(self, "Unable to reomove symbolic link ...\n") - def copyfile(self, src, dest): + def copyfiles(self, src, dest): """ Copies files: src : source path dest : destination path + + Recursively copy an entire directory tree rooted at src. + The destination directory, named by dst, must not already exist; + it will be created as well as missing parent directories. + """ + try: + Log.debug(self, "Copying files, Source:{0}, Dest:{1}" + .format(src, dest)) + shutil.copytree(src, dest) + except shutil.Error as e: + Log.debug(self, "{0}".format(e)) + Log.error(self, 'Unable to copy files from {0} to {1}' + .format(src, dest)) + except IOError as e: + Log.debug(self, "{0}".format(e.strerror)) + Log.error(self, "Unable to copy files from {0} to {1}" + .format(src, dest)) + + def copyfile(self, src, dest): + """ + Copy file: + src : source path + dest : destination path """ try: Log.debug(self, "Copying file, Source:{0}, Dest:{1}"