Python part check script

As threatened I have uploaded a python script to github that accepts a variety of file formats including an entire directory such as core, and checks and complains about things it finds wrong and (in the case of svgs) makes changes to the Inkscape output to make Fritzing happier with the xml. The README.md file (which github appears to have utterly mangled) has as much documentation as there is, which includes installation and testing instructions and a basic description of what the error messages are trying to tell you. If it breaks (which it probably will at some point) either open an issue on github and once I figure out what I’m doing (which may take a long time) I’ll try and fix it or you can ask here. So far it runs without crashing (but complaining loudly, but with justification) all the way through core so its at least somewhat stable after a year of development, but is at best alpha code. Doing the couple of hundred parts in core takes about 5 minutes on my Windows7 box YMMV. Note that you can (and I do, but it is off by default) cause the script to change a terminalId that is 0 width to 10 (10 thou if your scaling is standard, who knows if not :slight_smile: ). It issues an error for each modified pin because the x/y coords will have changed and need to be manually adjusted. I’d rather do this than try and change all the pins with xml editor one at a time (and a select in Inkscape will not select a 0 width or height entity …).

Edit: The Fritzing folks have forked a copy of my repro on the fritzing github page making that the preferred place to grab a copy of this code.

gets me to the repository (hopefully it will do the same for you). As noted in the README.md it has been tested under cygwin on Windows and un Ubuntu 16.04 lts Linux, if someone can make it work on MacOS I’d be happy to add the instructions (assuming I can unscrew the README.md file anyway and figure out how to make changes on github). Now hopefully I’m going to focus on Fritzing development for a while …

Edit: since I ran across a bug in the script while fixing a part I guess development is going to wait for a bit …

Edit2: Worse yet, the script as currently posted is broken (attempting to process an svg causes a traceback). I think it may be mostly working for fzp files but until I get it fixed I wouldn’t depend on the output. Sigh.

Peter

2 Likes