We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4
import os
import shutil import logging from pathlib import Path
# --- Configuration ---
SOURCE_DIR = Path("C:/path/to/your/GemAssist/folder") # Replace with the actual path to your GemAssist folder DEST_DIR = Path("C:/GemAssist_Alt") # Destination directory for the reorganized structure LOG_FILE = Path("gemassist_reorganize.log")
async def reorganize_gemassist(): """Main function to reorganize the GemAssist folder.""" try: logger.info("Starting GemAssist folder reorganization...")
# 1. Create Destination Directory
shutil.rmtree(DEST_DIR, ignore_errors=True) DEST_DIR.mkdir(parents=True, exist_ok=True) logger.info(f"Created destination directory at {DEST_DIR}")
# 2. Copy and Reorganize Files
for file_name, dest_path in FILE_MAPPING.items(): source_file = SOURCE_DIR / file_name if source_file.exists(): dest_file = DEST_DIR / dest_path dest_file.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(source_file, dest_file) logger.info(f"Copied {file_name} to {dest_path}") else: logger.warning(f"File not found: {source_file}")