diff --git a/ltchiptool/gui/main.py b/ltchiptool/gui/main.py index 35dba2c..f427cf9 100644 --- a/ltchiptool/gui/main.py +++ b/ltchiptool/gui/main.py @@ -85,7 +85,7 @@ def __init__(self, *args, **kw): windows = [ ("flash", FlashPanel), - ("plugins", (not ltim.is_bundled) and PluginsPanel), + ("plugins", PluginsPanel), ("install", ltim.is_gui_entrypoint and os.name == "nt" and InstallPanel), ("about", AboutPanel), ] diff --git a/ltchiptool/gui/panels/plugins.py b/ltchiptool/gui/panels/plugins.py index ee25cb5..654443f 100644 --- a/ltchiptool/gui/panels/plugins.py +++ b/ltchiptool/gui/panels/plugins.py @@ -11,6 +11,7 @@ from ltchiptool.gui.utils import on_event, with_event from ltchiptool.gui.work.plugins import PluginsThread from ltchiptool.util.lpm import LPM +from ltchiptool.util.ltim import LTIM from ltctplugin.base import PluginBase from .base import BasePanel @@ -223,6 +224,7 @@ def __init__(self, parent: wx.Window, frame): self.LoadXRC("PluginsPanel") self.AddToNotebook("Plugins") + self.ltim = LTIM.get() self.lpm = LPM.get() self.model = PluginsDataModel() self.results: list[LPM.SearchResult] = [] @@ -242,6 +244,29 @@ def __init__(self, parent: wx.Window, frame): self.InstallInput = self.BindTextCtrl("input_install") self.InstallButton = self.BindButton("button_install", self.OnInstallClick) + self.SitePath = self.BindTextCtrl("input_site_path") + self.SiteReason = self.FindStaticText("text_site_reason") + + reason = "unknown" + if self.ltim.is_bundled: + if self.ltim.is_windows(): + reason = "running Windows .EXE bundle" + elif self.ltim.is_macos(): + reason = "running macOS App Bundle" + else: + reason = "running a bundled copy" + elif self.lpm.plugin_site_path: + reason = "path set in sitecustomize.py" + elif self.ltim.is_dev: + reason = "development copy - editable" + elif "site-packages" in __file__: + reason = "installed using pip" + + self.SitePath.SetLabelText( + str(self.lpm.plugin_site_path or "Python-default site-packages") + ) + self.SiteReason.SetLabel(f"(reason: {reason})") + def OnWorkStopped(self, t: PluginsThread): super().OnWorkStopped(t) if t.search: diff --git a/ltchiptool/gui/res/ltchiptool.wxui b/ltchiptool/gui/res/ltchiptool.wxui index 0954b73..47927e1 100644 --- a/ltchiptool/gui/res/ltchiptool.wxui +++ b/ltchiptool/gui/res/ltchiptool.wxui @@ -650,6 +650,20 @@ orientation="wxVERTICAL" var_name="sizer_main_plugins" flags="wxEXPAND"> + + + wxTAB_TRAVERSAL wxVERTICAL + + wxTOP|wxRIGHT|wxLEFT + 5 + + + -1 + + + + wxALL|wxEXPAND + 5 + + + + + + wxBOTTOM|wxRIGHT|wxLEFT + 5 + + + -1 + + wxALL|wxEXPAND 5 @@ -799,7 +822,7 @@ wxALL|wxEXPAND 5 - +