Spaces:
Running
Running
made move instead of copy
Browse files
import_local_tts_models.py
CHANGED
|
@@ -8,15 +8,12 @@ destination_dir = '/home/user/.local/share/tts/'
|
|
| 8 |
# Create destination directory if it doesn't exist
|
| 9 |
os.makedirs(destination_dir, exist_ok=True)
|
| 10 |
|
| 11 |
-
#
|
| 12 |
for item in os.listdir(source_dir):
|
| 13 |
source_path = os.path.join(source_dir, item)
|
| 14 |
destination_path = os.path.join(destination_dir, item)
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
shutil.copytree(source_path, destination_path, dirs_exist_ok=True)
|
| 19 |
-
else:
|
| 20 |
-
shutil.copy2(source_path, destination_path)
|
| 21 |
|
| 22 |
-
print("Contents
|
|
|
|
| 8 |
# Create destination directory if it doesn't exist
|
| 9 |
os.makedirs(destination_dir, exist_ok=True)
|
| 10 |
|
| 11 |
+
# Move all contents from source to destination
|
| 12 |
for item in os.listdir(source_dir):
|
| 13 |
source_path = os.path.join(source_dir, item)
|
| 14 |
destination_path = os.path.join(destination_dir, item)
|
| 15 |
|
| 16 |
+
# Move files or directories
|
| 17 |
+
shutil.move(source_path, destination_path)
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
print("Contents moved successfully.")
|