Mercurial > repos > greg > gene_family_classifier
diff utils.py @ 154:36ed0037292a draft
Uploaded
author | greg |
---|---|
date | Wed, 04 Oct 2017 13:48:14 -0400 |
parents | 1a2a918563d4 |
children | bbfecb0ebe75 |
line wrap: on
line diff
--- a/utils.py Thu Aug 24 13:21:37 2017 -0400 +++ b/utils.py Wed Oct 04 13:48:14 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):