diff --git a/Documentation.md b/Documentation.md index dd867cd..4bdd649 100644 --- a/Documentation.md +++ b/Documentation.md @@ -2,7 +2,7 @@ ## Table of Contents 1. [Overview](#overview) -2. [Features](#features) +2. [Build System](#build-system) 3. [Code Structure](#code-structure) 4. [Class Reference](#class-reference) 5. [Function Documentation](#function-documentation) @@ -14,19 +14,48 @@ PNG Metadata Editor is a graphical application built with Python and Tkinter that allows users to view, edit, add, and delete metadata in PNG files. The application leverages the Pillow library for PNG manipulation. -## Features +## Build System -### Core Functionality -- **Metadata Viewing**: Display all text chunks (tEXt, zTXt, iTXt) in PNG files -- **Metadata Editing**: Add, modify, and delete metadata fields -- **JSON Support**: Pretty-print JSON-formatted values -- **Clipboard Integration**: Copy metadata values to clipboard +### build.py Functionality -### UI Features -- Split-pane view with tree and detail panels -- Status bar with temporary messages -- Unsaved changes indicator -- Responsive dialogs for adding/editing fields +The `build.py` script provides a unified way to build the application across platforms: + +1. **Dependency Management**: + - Checks for `requirements.txt` and installs dependencies + - Falls back to default dependencies if file not found + +2. **PyInstaller Handling**: + - Verifies PyInstaller is installed + - Automatically installs it if missing + - Provides clear error messages if installation fails + +3. **Platform-Specific Builds**: + - Detects operating system (Windows, macOS, Linux) + - Applies appropriate build options for each platform + - Includes version information from `version.txt` when available + +4. **Build Process**: + ```python + # Main build workflow: + 1. Check/install PyInstaller + 2. Install dependencies + 3. Determine platform options + 4. Execute PyInstaller build + ``` + +### Build Requirements + +- Python 3.6+ +- PyInstaller (auto-installed if missing) +- Platform-specific icon files: + - `AppIcon.ico` for Windows + - `AppIcon.icns` for macOS + +### Build Output + +- Executable is created in the `dist/` directory +- Temporary build files are stored in `build/` +- Version information is embedded from `version.txt` ## Code Structure @@ -37,7 +66,6 @@ png-meta-editor.py │ ├── __init__() - Initialization │ ├── setup_ui() - UI Construction │ ├── open_file() - File Operations -│ ├── save_changes() - Save Functionality │ └── Various helper methods └── Supporting Functions ├── format_value_for_display() @@ -249,10 +277,18 @@ if app.has_unsaved_changes: ## Development Notes -### Design Decisions -1. **State Management**: Uses `has_unsaved_changes` flag to track modifications -2. **UI Separation**: Treeview and detail view maintain separate data representations -3. **Error Handling**: Graceful degradation with user-friendly messages +### Build System Improvements +1. **Automatic Dependency Installation**: + - Script checks for `requirements.txt` + - Installs dependencies automatically + +2. **PyInstaller Management**: + - Verifies PyInstaller installation + - Auto-installs if missing + +3. **Platform Detection**: + - Automatically applies correct build options + - Handles version information consistently ### Future Improvements - Batch processing for multiple files