Differences From Artifact [3b783d8a38]:
- File helpers.py — part of check-in [7abc9dbabe] at 2020-10-10 06:53:37 on branch trunk — [build] add Dockerfile to Grammalecte package (user: olr, size: 4747) [annotate] [blame] [check-ins using] [more...]
To Artifact [864faa54a3]:
- File helpers.py — part of check-in [652870dcf1] at 2025-11-24 16:56:04 on branch trunk — [build][fr] drop the obsolete distutils library and fix the thesaurus builder (user: olr, size: 4904) [annotate] [blame] [check-ins using]
| ︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | + + + + + + |
def createCleanFolder (sp):
"make an empty folder or erase its content if not empty"
if not os.path.exists(sp):
os.makedirs(sp, exist_ok=True)
else:
eraseFolderContent(sp)
def createFolder (sp):
"make a folder if it doesn’t exist; don’t change anything if it exists"
if not os.path.exists(sp):
os.mkdir(sp)
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:
|
| ︙ |