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

Error caused by some nightly builds enclosing the version string in parentheses #5

Open
mcbridejc opened this issue Jul 27, 2022 · 5 comments

Comments

@mcbridejc
Copy link
Owner

Created based on feedback in Issue #3

Sometimes, when using the script with kicad nightly, it would fail with `TypeError: in method 'FOOTPRINT_SetPosition', argument 2 of type 'VECTOR2I const &'.

This is because nightly builds use a different type for positions. The plugin does a version check for '6.99' to handle this, but it seems
some versions of KiCad nightly, on some platforms, report a the version string enclosed in parenthese and these aren't handled by the plugin.

@mcbridejc
Copy link
Owner Author

@jerseyp2 Do you want to try out the change I just merged and let me know if that resolves your issue?

@jerseyp2
Copy link

@mcbridejc I started with a fresh download and example of your merged zip. When I open the project in kicad and run the external plugin, nothing appears to happen, which I expect is normal if I haven't changed any positions in the default yaml.layout. If I run the external plug again, without changing anything, I get this error:

File: C:\Program Files\KiCad\6.99\bin\Lib\logging\__init__.py, line 1086, in emit stream.write(msg + self.terminator) AttributeError: 'None Type' object has no attribute 'write'.

That error appears every time I run the external plugin, but not the very first time. I didn't change anything in the example folder.

Since this is a Kicad error, maybe it has nothing to do with the plugin. Thanks for looking into it. Let me know if there's anything I can try.

@mcbridejc
Copy link
Owner Author

OK. That sounds like something new. I did some dumb hackery to get logging output to a file in the project directory but I've only ever used it on linux, and I bet there's something going wrong with the python environment that comes with kicad windows. I'm sorry about that. I can look into how to fix it, but the quick way to get it running is probably just to remove the logging code.

You didn't by chance get a full stack with that error? I'm interested to see where in component_layout_plugin.py it originated if it said.

@jerseyp2
Copy link

I did see this at one point:
Call stack: File "C:\Users/User/Documents/KiCad/6.99/scripting\plugins\component_layout_plugin - Copy.py", line 84, in Run logger.info('Logging to {}...'.format(os.path.join(projdir, "component_layout_plugin.log")))
I'm trying to comment out the logging, but am having trouble with Kicad not refreshing the plugin. I don't think the error was caused by my attempts at that, so maybe it's worth a look.

@jerseyp2
Copy link

In the error message I sent, Kicad is running my "component_layout_plugin - Copy.py", which I copied as a backup. I didn't think it would do that since I effectively renamed the plugin. Adding to my confusion.

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