Mercurial > repos > greg > assembly_post_processor
diff utils.py @ 74:9da5dc4b99cc draft
Uploaded
author | greg |
---|---|
date | Thu, 05 Oct 2017 13:54:37 -0400 |
parents | 45aa928ed5df |
children | 1a216a9837c7 |
line wrap: on
line diff
--- a/utils.py Thu Aug 24 13:04:03 2017 -0400 +++ b/utils.py Thu Oct 05 13:54:37 2017 -0400 @@ -27,7 +27,7 @@ return fstderr, fherr, fstdout, fhout -def move_directory_files(source_dir, destination_dir, copy=False): +def move_directory_files(source_dir, destination_dir, copy=False, remove_source_dir=False): source_directory = os.path.abspath(source_dir) destination_directory = os.path.abspath(destination_dir) if not os.path.isdir(destination_directory): @@ -38,6 +38,8 @@ shutil.copy(source_entry, destination_directory) else: shutil.move(source_entry, destination_directory) + if remove_source_dir: + os.rmdir(source_directory) def run_command(cmd):