Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KiBuzzard disappears from action plugins list after refreshing plugins #30

Closed
robin7331 opened this issue Apr 11, 2021 · 8 comments
Closed

Comments

@robin7331
Copy link
Contributor

When I hit Refresh Plugins the KiBuzzard Icon disappears from the toolbar and only reappears when I relaunch KiCad.

Screenshot 2021-04-11 at 15 57 54

After refreshing the plugins I am still able to try to launch the plugin from the scripting console but I get a TypeError.

Screenshot 2021-04-11 at 15 57 42@2x

By the way, this is a nice way to test the code without restarting KiCad or being able to successfully reload the plugins. To run the code simply import KiBuzzard and then run the plugin via KiBuzzard.KiBuzzard.plugin.Run()

@gregdavill
Copy link
Owner

Ahh, neat! Thanks for digging into this.

I do have the same issue, and I see other plugins don't do this, so this is probably something we can fix.

@robin7331 robin7331 changed the title TypeError in plugin.py after running KiCad's Refresh Plugins KiBuzzard disappears from action plugins list after refreshing plugins Apr 12, 2021
@robin7331
Copy link
Contributor Author

robin7331 commented Apr 12, 2021

I renamed the issue to a more appropriate title. Because the actual issue is that this plugin disappears when refreshing the plugins.
That it might be because of a TypeError is only a guess 😋

I'll look into this again today.

@gregdavill
Copy link
Owner

Hmm. This morning I couldn't repo this, the button never disappeared.

But just then I did have it happen just now. But after restarting KiCad It's now not disappearing...

@robin7331
Copy link
Contributor Author

robin7331 commented Apr 12, 2021

That's weird. Happens to me all the time.
On what python version is this stuff running on your end?

And when you get the icon to disappear. Do you get the same error when you try to launch the plugin via the scripting console as seen in the screenshot?

@gregdavill
Copy link
Owner

Yeah, I've seen it happen to me too. Weird that it's now in a state that works....

I'm on Python 3.8.6 (default, Jan 27 2021, 15:42:20)
KiCad-Nightly: Version: 5.99.0-unknown-675444a646~125~ubuntu20.10.1, release build

I was going to try that. But I thought I needed to be in the correct directory for import KiBuzzard to work...

@robin7331
Copy link
Contributor Author

robin7331 commented Apr 12, 2021

Opening the scripting console and running import KiBuzzard should work regardless of the directory since it was loaded as a module. (At least I believe that's the reason 😅 )

@gregdavill
Copy link
Owner

Can you try with 6218cf3?

I might need to deep dive into how the python plugins are imported.
But I've tweaked the initial import slightly, seems to work here. But maybe I'm just not hitting the issue...

@robin7331
Copy link
Contributor Author

Wohooo! It seems fixed! 🚀
I can refresh the plugins and it still exists. 🤩

And the best part is: It also takes code changes into consideration. No more having to restart KiCad when some python code has changed. Extremely good for the dev workflow.

Great job Greg!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants