diff utils.py @ 51:9962341547d3 draft

Uploaded
author greg
date Thu, 05 Oct 2017 14:23:17 -0400
parents 88c9bd1583d8
children 8013d394c525
line wrap: on
line diff
--- a/utils.py	Fri Sep 08 10:47:33 2017 -0400
+++ b/utils.py	Thu Oct 05 14:23:17 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):