Commit Graph

13 Commits

Author SHA1 Message Date
Salvador E. Tropea ef24d19ef2 Macropy adaptation
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.
2020-07-11 19:22:54 -03:00
Salvador E. Tropea f72ff3f441 Extra dot in step.metric_units docstring.
Remove dead code in check_eeschema_do()
Fixed the way we read scale stuff from a PCB
Added special checks for check_script and check_version
2020-07-09 12:50:27 -03:00
Salvador E. Tropea a48e9ecc96 Added tests to cover out_pdf_pcb_print.py, error case left out 2020-07-09 09:20:52 -03:00
Salvador E. Tropea 4368364489 Refactored the BaseOutput class to make it more similar to the YAML
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.
2020-07-08 15:17:24 -03:00
Salvador E. Tropea 1c4c94cfa2 Some super() use clean-up.
Now using Python3 style everywhere.
Added some missing calls to allow more cases of use.
2020-07-05 19:11:52 -03:00
Salvador E. Tropea 4ae54f3ded Added --example/-x option to generate a configuration example.
The example contains all the available preflights and outputs.
If the user specifies a PCB the names of the layers are from the provided PCB
2020-06-30 20:09:14 -03:00
Salvador E. Tropea 3c6f4950c7 Now the schematic can be specified separately.
We now test if the PCB and/or SCH are there only when we need them.
2020-06-29 19:25:54 -03:00
Salvador E. Tropea 42d1f14056 Now layers are solved when we really need it.
So we can do some operations (like --list) without loading the board.
Also: now the names for the layers are asked to pcbnew classes (not from file)
2020-06-29 12:55:02 -03:00
Salvador E. Tropea f70e484780 Excluded from coverage the last line of the with document block
This isn't recorded as executed and I don't know how to inform to coverage
that this is executed. SO I'm just excluding them.
2020-06-26 14:46:09 -03:00
Salvador E. Tropea 5ce3da2bcc Added a macro decorator to register output classes. 2020-06-25 11:32:13 -03:00
Salvador E. Tropea fa1ea5bdc9 Outputs help and options review
- 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)
2020-06-25 09:05:46 -03:00
Salvador E. Tropea 89fb93d6d7 Documented the output formats in the source code. 2020-06-24 11:01:43 -03:00
Salvador E. Tropea 7679604646 Major code refactor
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.
2020-06-19 15:54:55 -03:00