Mercurial > libervia-backend
diff sat/tools/common/files_utils.py @ 3246:5ba0b1cdd45b
tools (common/files_utils): put extra suffix before file extension
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 01 Apr 2020 22:29:43 +0200 |
parents | 559a625a236b |
children | e86b71b1aa31 |
line wrap: on
line diff
--- a/sat/tools/common/files_utils.py Wed Apr 01 22:28:50 2020 +0200 +++ b/sat/tools/common/files_utils.py Wed Apr 01 22:29:43 2020 +0200 @@ -30,6 +30,6 @@ ori_path = path = Path(path) idx = 1 while path.exists(): - path = ori_path.with_name(ori_path.name + f"_{idx}") + path = ori_path.with_name(f"{ori_path.stem}_{idx}{ori_path.suffix}") idx += 1 return path