Closed alexvlockwood-bes closed 3 years ago
Interesting I've not seen this behavior before on my test setups.
When KiBuzzard runs it generates a kibuzzard.log
file with some debug info. Is there anything interesting in there when you attempt to make a footprint without the console open?
One thought. The plugin uses a a wx_widgets call to switch focus to pcbnew and run a Ctrl+V
to enable interactive placement of a label, maybe this isn't working correctly with the window manager you're using on Debian?
oh no i couldn't resist hopping on my personal account at midnight on a friday night to follow up lol
WM is just xfce, looks like an environment variable isn't getting set so it's not showing up in the version info.
But I have a fix! Sort of. I doubt this is the proper fix since what you have looks like it's supposed to work according to the docs, but hopefully, it's a pointer in the right direction. I don't really know wxpython. If I make this change, it works
diff --git a/KiBuzzard/plugin.py b/KiBuzzard/plugin.py
index b48a1d4..b0bc337 100644
--- a/KiBuzzard/plugin.py
+++ b/KiBuzzard/plugin.py
@@ -83,9 +83,9 @@ class KiBuzzardPlugin(pcbnew.ActionPlugin, object):
footprint_string = p_buzzard.create_v6_footprint()
- if wx.TheClipboard.Open():
- wx.TheClipboard.SetData(wx.TextDataObject(footprint_string))
- wx.TheClipboard.Close()
+ if wx.Clipboard.Get().Open():
+ wx.Clipboard.Get().SetData(wx.TextDataObject(footprint_string))
+ wx.Clipboard.Get().Close()
dlg.EndModal(wx.ID_OK)
(btw this is what's in kibuzzard.log
. Thanks for pointing out that file
05-08 00:32:01 STDERR 138:Traceback (most recent call last):
05-08 00:32:01 STDERR 138: File "/home/alex/.local/share/kicad/5.99/scripting/plugins/KiBuzzard/KiBuzzard/dialog/dialog.py", line 255, in OnOkClick
05-08 00:32:01 STDERR 138:self.func(self, self.buzzard)
05-08 00:32:01 STDERR 138: File "/home/alex/.local/share/kicad/5.99/scripting/plugins/KiBuzzard/KiBuzzard/plugin.py", line 86, in run_buzzard
05-08 00:32:01 STDERR 138:if wx.TheClipboard.Open():
05-08 00:32:01 STDERR 138: File "/usr/lib/python3/dist-packages/wx/core.py", line 1337, in __getattr__
05-08 00:32:01 STDERR 138:return getattr(self._instance, name)
05-08 00:32:01 STDERR 138:AttributeError
05-08 00:32:01 STDERR 138::
05-08 00:32:01 STDERR 138:'NoneType' object has no attribute 'Open'
Thanks for finding that fix. I'm not a pro with wx either. But the docs appear to make sense here.
https://wiki.wxpython.org/ClipBoard
static Get()
Returns the global instance (wxTheClipboard) of the clipboard object.
I guess for some reason wx.TheClipboard
wasn't being initialized.
On my 5.99 setup, KiBuzzard fails to generate the footprint (OK button just does nothing) unless the Python console has been opened at least once in that session.
If I can provide any more relevant info, let me know! I don't see any error messages show up anywhere.