From 7c691a57530eff49ccac187800c5acec577b4334 Mon Sep 17 00:00:00 2001 From: Kota Karthik <119888263+Kota-Karthik@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:57:40 +0530 Subject: [PATCH] Revert "[Enhancement] TwinTrim Website" --- docs/Contributing.md | 5 --- docs/Features.md | 8 ----- docs/How-It-Works.md | 27 --------------- docs/License.md | 3 -- docs/Usage.md | 56 ------------------------------- docs/index.md | 78 -------------------------------------------- mkdocs.yml | 23 ------------- requirements.txt | 4 --- 8 files changed, 204 deletions(-) delete mode 100644 docs/Contributing.md delete mode 100644 docs/Features.md delete mode 100644 docs/How-It-Works.md delete mode 100644 docs/License.md delete mode 100644 docs/Usage.md delete mode 100644 docs/index.md delete mode 100644 mkdocs.yml delete mode 100644 requirements.txt diff --git a/docs/Contributing.md b/docs/Contributing.md deleted file mode 100644 index b9fa34e..0000000 --- a/docs/Contributing.md +++ /dev/null @@ -1,5 +0,0 @@ -# Contributing - -Contributions are welcome! Whether you have ideas for improving the internal workings of TwinTrim, such as optimizing performance or refining algorithms, or you want to enhance the user interface of the CLI tool for a better user experience, your input is valuable. Please fork the repository and submit a pull request with your improvements or new features. - -Please refer to the [CONTRIBUTING GUIDELINES](../CONTRIBUTION_GUIDELINES.md) for guidelines on how to contribute. diff --git a/docs/Features.md b/docs/Features.md deleted file mode 100644 index 60caac4..0000000 --- a/docs/Features.md +++ /dev/null @@ -1,8 +0,0 @@ -# Features - -- **Duplicate Detection**: Scans directories to detect duplicate files based on file content rather than just filenames. -- **Automatic or Manual Removal**: Choose to handle duplicates automatically using the `--all` flag or manually select which files to delete. -- **Customizable Filters**: Set filters for minimum and maximum file sizes, file types, and specific filenames to exclude from the scan. -- **Multi-Threaded Processing**: Utilizes multi-threading to quickly scan and process large numbers of files concurrently. -- **Deadlock Prevention**: Implements locks to prevent deadlocks during multi-threaded operations, ensuring smooth and safe execution. -- **User-Friendly Interface**: Offers clear prompts and feedback via the command line, making the process straightforward and interactive. diff --git a/docs/How-It-Works.md b/docs/How-It-Works.md deleted file mode 100644 index 5aa068d..0000000 --- a/docs/How-It-Works.md +++ /dev/null @@ -1,27 +0,0 @@ -# How It Works - -## Core Components - -1. **File Metadata Management**: - - Uses `AllFileMetadata` and `FileMetadata` classes to manage file information, such as modification time and file paths. - - Maintains metadata in two dictionaries (`store` and `normalStore`) for handling different levels of duplicate management. - -2. **File Hashing**: - - Generates a unique hash for each file using MD5 to identify duplicates by content. - -3. **File Filtering**: - - The `FileFilter` class provides functionality to filter files based on size, type, and exclusions. - -4. **Duplicate Handling**: - - Duplicate files are identified by comparing their hashes. - - Based on file modification time, the latest file is retained, and older duplicates are removed. - -5. **Deadlock Prevention**: - - Uses locks within multi-threaded processes to ensure that resources are accessed safely, preventing deadlocks that could otherwise halt execution. - -## Key Functions - -- **add_or_update_file**: Adds new files to the metadata store or updates existing entries if a duplicate is detected. -- **add_or_update_normal_file**: Similar to `add_or_update_file` but manages duplicates in a separate store. -- **handleAllFlag**: Handles duplicate removal automatically without user intervention. -- **find_duplicates**: Finds duplicate files in the specified directory and prepares them for user review or automatic handling. diff --git a/docs/License.md b/docs/License.md deleted file mode 100644 index dc4cb60..0000000 --- a/docs/License.md +++ /dev/null @@ -1,3 +0,0 @@ -# License - -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/docs/Usage.md b/docs/Usage.md deleted file mode 100644 index ce47346..0000000 --- a/docs/Usage.md +++ /dev/null @@ -1,56 +0,0 @@ -## Usage - -### Command Line Interface - -Run the script using the following command: -```bash -python -m twinTrim.main [OPTIONS] -``` - -### Options - -- `--all`: Automatically delete duplicates without asking for confirmation. -- `--min-size`: Specify the minimum file size to include in the scan (e.g., `10kb`). -- `--max-size`: Specify the maximum file size to include in the scan (e.g., `1gb`). -- `--file-type`: Specify the file type to include (e.g., `.txt`, `.jpg`). -- `--exclude`: Exclude specific files by name. -- `--label-color`: Set the font color of the output label of the progress bar. -- `--bar-color`: Set the color of the progress bar. - -### Examples - -1. **Automatic Duplicate Removal**: - ```bash - python -m twinTrim.main /path/to/directory --all - ``` - -2. **Manual Review and Removal**: - ```bash - python -m twinTrim.main /path/to/directory - ``` - -3. **Filtered Scan by File Size and Type**: - ```bash - python -m twinTrim.main /path/to/directory --min-size "50kb" --max-size "500mb" --file-type "txt" - ``` - -## Dependencies - -- Python 3.6+ -- `click` for command-line interaction -- `tqdm` for progress bars -- `concurrent.futures` for multi-threaded processing -- `beaupy` for interactive selection - -## Installation - -Clone the repository and install the required dependencies using Poetry: - -```bash -git clone https://github.com/Kota-Karthik/twinTrim.git -cd twinTrim -poetry install -poetry shell -``` - -If you haven't installed Poetry yet, you can do so by following the instructions on the [Poetry website](https://python-poetry.org/docs/#installation). diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index a77e6f4..0000000 --- a/docs/index.md +++ /dev/null @@ -1,78 +0,0 @@ -# Getting Started with TwinTrim - -Welcome to the TwinTrim getting started guide! This document will walk you through the steps to get started with the project. - -### Prerequisites - -Before you begin, ensure you have met the following requirements: - -- **Python Installation**: You have installed the latest version of Python. -- **GitHub Account**: You have a GitHub account. - -### Installing TwinTrim - -To install TwinTrim, follow these steps: - -1. **Clone the Repository**: Clone the repository from GitHub. - - ```bash - git clone https://github.com/Kota-Karthik/twinTrim - ``` - -2. **Navigate to Project Directory**: Navigate to the project directory. - - ```bash - cd twinTrim - ``` - -3. **Install Dependencies**: Install the required dependencies using the following command: - - ```bash - pip install -r requirements.txt - ``` - -### Running TwinTrim - -To run TwinTrim, follow these steps: - -1. **Navigate to Project Directory**: Navigate to the project directory. -2. **Run the Application**: Run the following command: - - ```bash - python app.py - ``` - -The application will start running on your local server. You can access it by navigating to `http://localhost:5000` in your web browser. - -### Contributing to TwinTrim - -To contribute to TwinTrim, follow these steps: - -1. **Fork the Repository**: Fork the repository on GitHub from [here](https://github.com/Kota-Karthik/twinTrim/fork). - -2. **Create a New Branch**: Create a new branch. - - ```bash - git checkout -b new-branch-name - ``` - -3. **Make Changes**: Make your changes and commit them. - - ```bash - git commit -m "commit message" - ``` - -4. **Push Changes**: Push your changes to your fork. - - ```bash - git push origin new-branch-name - ``` - -5. **Create a Pull Request**: Create a pull request, from your fork to the main project. - -Your changes will be reviewed and merged into the main project. - -### Contact - -If you have any questions or need further assistance, please contact us at [Karthik Kota](https://www.linkedin.com/in/karthik-kota-44708924b/). - diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 257b5ea..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,23 +0,0 @@ -site_name: TwinTrim Docs -site_url: https://twintrim.com/docs -repo_url: https://github.com/Kota-Karthik/twinTrim -repo_name: Kota-Karthik/twinTrim -theme: - name: material - features: - - navigation.tabs # Add this line to enable tabs in the navigation - - navigation.sections # Add this line to enable sections in the navigation - - navigation.instant # Add this line to enable instant navigation - - navigation.instant.progress # Add this line to enable instant navigation progress - icon: - repo: fontawesome/brands/github - - palette: - scheme: slate - -nav: - - Home: index.md - - Usage: Usage.md - - Contributing: Contributing.md - - How It Works: How-It-Works.md - - License: License.md \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f7581a9..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mkdocs-material -mkdocs-material-extensions -mkdocs -