Index: helpers.py ================================================================== --- helpers.py +++ helpers.py @@ -60,19 +60,19 @@ os.makedirs(sp, exist_ok=True) else: eraseFolder(sp) -def copyFolderContent (spSrc, spDst): +def copyFolder (spSrc, spDst): "copy folder content from src to dst" try: shutil.copytree(spSrc, spDst) except OSError as e: if e.errno == errno.ENOTDIR: shutil.copy(spSrc, spDst) else: - raise + print("Error while copying folder <"+spSrc+"> to <"+spDst+">.") def moveFolderContent (spSrc, spDst, sPrefix="", bLog=False): "move folder content from to : if files already exist in , they are replaced. (not recursive)" try: @@ -87,12 +87,13 @@ if os.path.isfile(spfSrc): spfDst = os.path.join(spDst, sPrefix + sf) shutil.move(spfSrc, spfDst) if bLog: print("file <" + spfSrc + "> moved to <"+spfDst+">") - except: - raise + except Error as e: + print("Error while moving folder <"+spSrc+"> to <"+spDst+">.") + print(e) def fileFile (spf, dVars): "return file as a text filed with variables from " return Template(open(spf, "r", encoding="utf-8").read()).safe_substitute(dVars)