From f5b4206a2a25722b8ce99e839a02c369989d8dfb Mon Sep 17 00:00:00 2001 From: Marwan Zouinkhi Date: Tue, 18 Feb 2025 13:48:20 -0500 Subject: [PATCH] remove tmp --- remove_all.py | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 remove_all.py diff --git a/remove_all.py b/remove_all.py deleted file mode 100644 index baa01286..00000000 --- a/remove_all.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import re - -def remove_docstrings_from_file(file_path): - with open(file_path, 'r') as file: - content = file.read() - - # Pattern to match single-line and multi-line docstrings - docstring_pattern = r'(""".*?"""|\'\'\'.*?\'\'\')' - updated_content = re.sub(docstring_pattern, '', content, flags=re.DOTALL) - - with open(file_path, 'w') as file: - file.write(updated_content) - -def process_directory(directory_path): - for root, _, files in os.walk(directory_path): - for file in files: - if file.endswith('.py'): - file_path = os.path.join(root, file) - print(f"Removing docstrings from {file_path}") - remove_docstrings_from_file(file_path) - -if __name__ == "__main__": - directory_path = input("Enter the path to the directory: ") - process_directory(directory_path) -