Mcpy doesn't support compiled Python. So I decided to try Macropy, this is a
test.
Is much harder to get it working:
- The script must be a 2 liner, you can't activate it in any other way.
- The hook breaks the _import function in kiplot.py figuring out how to solve
it was a real challenge. It failed miserably passing the class instead of
the ast._ClassDef to the macro.
When I finally got it working I found the code supports compiled Python, but
runs almost 3 times slower.
I keep this in a branch in case I want to revisit it, but doesn't look useful.
Now the options are just an attribute of the outputs.
It means we have a set of classes for the options.
All the output content is parsed by the classes, including the Layers.
Now the layers support a simple string (with interesting shortcuts), a list of
strings or the original list of dicts.
- Included properties
- The final dot is placed by the printing code (removed from messages)
- docstrings line lengths limited
- Better HPGL help
- Fixed ibom default output (.html.html)
- pdf_pcb_print to use PCB name when not output name
- Default PS scaling factor to 1 (not 2)
Pro:
- Much easier to add new outputs and pre-flights
- All options are optional
- Much better configuration syntax check
- Access to data is simpler
Cons:
- Much more source code files
- I focused on one application, not multiple instances running on the same
process.