Skip to content

FBoissadier/WDTC_InherateWidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WDTC Inherate Widget

Overview

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.

Features

  • 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.

How It Works

  1. Select the Widget Folder: The script prompts you to select the folder of the widget you want to copy from the Brease library.
  2. Select the Custom Library Folder: You then select the destination folder for your custom widget library.
  3. Dependency Resolution: The script scans the widget's JavaScript file and recursively processes all dependencies, copying missing files and updating references.
  4. Widget Registration: If applicable, the script adds widget registration code to the copied widget.

Requirements

  • Python 3.13
  • The WDTC environment with the Brease widget library
  • A custom widget library folder to copy the widget into

Usage

  1. Clone this repository:

    git clone https://github.com/FBoissadier/WDTC_InherateWidget.git
    cd WDTC_InherateWidget
  2. Run the script:

    python main.py
  3. Follow the prompts to select the widget folder and the custom library folder.

Example

  • Source Widget: widgets/brease/DropDownBox
  • Destination Custom Library: widgets/customLib

After running the script:

  • The widget DropDownBox will be copied to widgets/customLib/DropDownBox.
  • All dependencies will be resolved and copied to the custom library.
  • You can now inherit from DropDownBox in your custom library.

Why Use This Script?

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.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the script

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages