$ show nwutils/Web2Executable
Web2Executable is a desktop application (with a CLI companion) that packages web applicationsβHTML, JavaScript, Node.js projectsβinto standalone executables for Windows, macOS, and Linux using the NW.js runtime. The GUI is built with PySide6 (Qt) and auto-generated from a declarative settings file (`files/settings.cfg`), providing tabs for app configuration, window properties, export targets, compression, and download management. The CLI (`command_line.py`) mirrors the GUI functionality and is the primary entry point for automation. Under the hood, it downloads NW.js binaries from the official site, copies user project files (with whitelist/blacklist filtering), optionally replaces the executable icon using custom PE and ICNS parsers (`pe.py`, `image_utils/`), and compresses the output with UPX. The architecture is a single-process monolith with a background thread pattern for non-blocking operations. While the tool is functional and has seen real use (974 stars), it is in maintenance mode with best-effort fixes, and parts of the codebase show age (e.g., custom implementations of ICNS/PNG format readers, reliance on specific NW.js version URLs, and fragile build scripts). Key reusable components include the dynamic configuration class (`Setting`), the file tree filter (`FileTree`), and the background worker (`BackgroundThread`), which could be extracted for other Qt-based projects.
The LLM identified 2 files worth highlighting for reuse:
Contains several well-isolated classes that could be reused in other Qt applications: the `Setting` class provides a declarative configuration object with type validation, defaults, and change callbacks; `FileTree` recursively enumerates files with fnmatch-based whitelist/blacklist filtering; `BackgroundThread` runs functions in a QThread to keep the UI responsive; `Validator` and `CompleterLineEdit` provide input validation and auto-completion. These components are decoupled from the rest of the application's business logic and can be extracted with minimal modification.
A pure-Python implementation for encoding and decoding Apple Icon Image (ICNS) files, supporting multiple icon types (PNG, JPEG-2000, and old-style icon families). It handles the hierarchical ICNS structure (icons wrapped in an archive) and demonstrates low-level binary parsing skills. This module is self-contained, requires no external dependencies, and could be reused in any Python project that needs to read or write ICNS icons.