Standalone Distribution Guide
Overview
This tool can generate a single-file standalone version of the event tree visualizer for easy distribution.
Building Standalone Version
Prerequisites
- Python 3.7+
- All project dependencies (graphviz, etc.)
Build Command
python3 build_standalone.py
This will generate event_tree_visualizer.py - a single executable Python file containing all modules.
Using the Standalone Version
Basic Usage
python3 event_tree_visualizer.py
Dump from Device
python3 event_tree_visualizer.py -r
Debug Mode
python3 event_tree_visualizer.py -d
Make Executable (Linux/macOS)
chmod +x event_tree_visualizer.py
./event_tree_visualizer.py
Distribution
The standalone script is ready for distribution:
- Copy the file to target system
- Install dependencies:
pip install graphviz - Install Graphviz executable:
- macOS:
brew install graphviz - Linux:
sudo apt-get install graphviz - Windows: Download from https://graphviz.org/download/
- macOS:
- Run the script
Benefits
✅ Single File: No need to copy the entire directory structure ✅ Easy Distribution: Just one file to share ✅ No Directory Requirements: Works from any location ✅ All Features: Includes all functionality (device dump, graph generation, etc.)
Limitations
⚠️ Generated Files: Still requires output/ directory for generated graphs
⚠️ Dependencies: External Python packages (graphviz) still required
⚠️ Updates: To update, rebuild from source
File Size
The standalone script is approximately 78 KB containing all 19 modules.
Technical Details
The standalone script:
- Combines all Python modules into a single file
- Uses
from __future__ import annotationsfor type hints - Removes inter-module imports (inlines all code)
- Preserves all functionality
- Adds clear module separators for readability
Troubleshooting
Build Fails
Ensure all source files are present:
ls -la src/
Runtime Error: Module Not Found
This shouldn't happen with the standalone version. If it does, rebuild:
rm event_tree_visualizer.py
python3 build_standalone.py
Permission Denied
Make the script executable:
chmod +x event_tree_visualizer.py
Example Workflow
-
Build standalone version:
python3 build_standalone.py -
Test it locally:
python3 event_tree_visualizer.py -
Distribute:
- Email the file
- Upload to shared drive
- Package with documentation
-
User receives file:
- Installs dependencies
- Runs script directly
Support
For issues with:
- Building: Check all source files are present
- Running: Verify dependencies installed
- Device dump: Ensure hdc tool available