diff utils.py @ 56:f782812220e1 draft

Uploaded
author greg
date Thu, 05 Oct 2017 14:14:56 -0400
parents ca7fb79c2eec
children 8d71c1dff476
line wrap: on
line diff
--- a/utils.py	Wed Oct 04 15:05:36 2017 -0400
+++ b/utils.py	Thu Oct 05 14:14:56 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):