gui: Add support for loading external installed modules - #106
Open
joshanne wants to merge 2 commits into
Open
Conversation
joshanne
force-pushed
the
pr/add-plugin-support
branch
from
December 11, 2025 02:33
8d7de29 to
7d7cade
Compare
tridge
force-pushed
the
pr/add-plugin-support
branch
from
March 25, 2026 04:37
7d7cade to
0c6fcdf
Compare
joshanne
force-pushed
the
pr/add-plugin-support
branch
from
March 30, 2026 20:32
0c6fcdf to
9b74042
Compare
joshanne
force-pushed
the
pr/add-plugin-support
branch
from
April 7, 2026 00:25
9b74042 to
2f4825c
Compare
joshanne
force-pushed
the
pr/add-plugin-support
branch
from
June 1, 2026 23:39
2f4825c to
fa7e98b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a simple plugin mechanism that allows the GUI tool to load externally installed panel modules (e.g., distributed as wheels) and surface them in the UI as additional menu entries.
Changes:
- Adds dynamic import support for panel modules via a new
import_panel()helper andPluginPanelDescriptor. - Introduces a
--load-moduleCLI flag to load one or more plugin modules at startup and register them into a new “Plugins” menu. - Adds support for optional hierarchical plugin menu placement via a
MENU_PATHattribute.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dronecan_gui_tool/panels/init.py | Adds plugin import helper and a descriptor subclass to wrap external panel modules. |
| dronecan_gui_tool/main.py | Adds CLI parsing, sys.path plugin directory injection, plugin loading, and a Plugins menu builder. |
Suppressed comments (2)
dronecan_gui_tool/panels/init.py:45
- import_panel() raises a generic Exception and prints to stdout. Using ModuleNotFoundError/ImportError keeps error handling idiomatic, and avoiding print prevents noisy output (the app already has logging configured).
def import_panel(name):
"""Given a package name like 'foo.bar.quux', imports the package
and returns the desired module."""
spec = importlib.util.find_spec(name)
mod = None
dronecan_gui_tool/main.py:273
- The shortcut string for plugin panels is malformed ("Ctrl+Shift+[,{n}") and likely won’t register as intended. The built-in Panels menu uses the standard Ctrl+Shift+ format.
if idx < 9:
action.setShortcut(QKeySequence(f'Ctrl+Shift+[,{(idx + 1)}'))
action.triggered.connect(lambda state, panel=panel: panel.safe_spawn(self, self._node))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allows for plugins to be loaded from ~/dronecan_gui_tool/plugin builds
joshanne
force-pushed
the
pr/add-plugin-support
branch
from
August 6, 2026 23:13
fa7e98b to
3053b5d
Compare
Collaborator
Author
|
Copilot found some legitimate issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been using a modified version of this for some time now.
It borrows from the idea that a user could extend the interface to provide their own functionality.
The most basic of plugin modules looks like so:
These modules can then be distributed as wheels and loaded by the user when required.