This Python script is designed to copy a widget from the Brease widget library of the WDTC (Widget Development Tool Chain) by B&R into a custom widget library. The script ensures that all dependencies of the widget are imported and updated, allowing you to extend or inherit from the copied widget in your custom library.
- Widget Copying: Copies a widget from the Brease widget library to a custom widget library.
- Dependency Management: Recursively imports all dependencies of the widget, including nested dependencies.
- Reference Updates: Updates all references from the Brease library to the custom library.
- Custom Widget Inheritance: Enables you to inherit from the copied widget in your custom library.
- Select the Widget Folder: The script prompts you to select the folder of the widget you want to copy from the Brease library.
- Select the Custom Library Folder: You then select the destination folder for your custom widget library.
- Dependency Resolution: The script scans the widget's JavaScript file and recursively processes all dependencies, copying missing files and updating references.
- Widget Registration: If applicable, the script adds widget registration code to the copied widget.
- Python 3.13
- The WDTC environment with the Brease widget library
- A custom widget library folder to copy the widget into
-
Clone this repository:
git clone https://github.com/FBoissadier/WDTC_InherateWidget.git cd WDTC_InherateWidget -
Run the script:
python main.py
-
Follow the prompts to select the widget folder and the custom library folder.
- Source Widget:
widgets/brease/DropDownBox - Destination Custom Library:
widgets/customLib
After running the script:
- The widget
DropDownBoxwill be copied towidgets/customLib/DropDownBox. - All dependencies will be resolved and copied to the custom library.
- You can now inherit from
DropDownBoxin your custom library.
This script simplifies the process of extending Brease widgets by automating the copying and dependency resolution process. It ensures that your custom library is self-contained and ready for further development.
Contributions are welcome! Feel free to submit issues or pull requests to improve the script
This project is licensed under the MIT License. See the LICENSE file for details.