File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ def parse_load_modules(argv):
8383#
8484# Importing other stuff once the logging has been configured
8585#
86+ from pathlib import Path
8687from serial import SerialException
8788
8889import dronecan
@@ -113,6 +114,14 @@ def parse_load_modules(argv):
113114from .panels import PANELS
114115from .panels import import_panel
115116
117+ # Add the User ~/dronecan_gui_tool/plugins folder to the import path,
118+ # allowing for custom plugin modules to be loaded from there.
119+ plugins_dir = Path .home () / "dronecan_gui_tool" / "plugins"
120+ if plugins_dir .exists ():
121+ str_plugin_dir = str (plugins_dir )
122+ if str_plugin_dir not in sys .path :
123+ sys .path .insert (0 , str_plugin_dir )
124+
116125EXT_PLUGINS = []
117126modules = args .load_module [0 ] if args .load_module else []
118127if len (modules ) > 0 :
You can’t perform that action at this time.
0 commit comments