Commit Graph

268 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 a23477d8c2 Fix in package dependency.
Missing python3-mcpy and the fact that mcpy can't be mixed with compiled
python.
2020-07-11 19:20:05 -03:00
Salvador E. Tropea 2dab2417e0 Bumped version to 0.5.0 2020-07-11 14:02:09 -03:00
Salvador E. Tropea 52e6bb1b5f Added support for PcbDraw 2020-07-11 13:49:03 -03:00
Salvador E. Tropea c468dd44e1 Removed unused log import 2020-07-09 18:50:29 -03:00
Salvador E. Tropea 558ef81195 Updated Coveralls badge. 2020-07-09 18:50:04 -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 587ef177b3 Added test for corrupted PCB, skip a preflight that isn't in use and output
plugin
2020-07-09 09:54:25 -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 2ade49bde5 Removed Layer.get_id(), no longer used. 2020-07-08 23:43:08 -03:00
Salvador E. Tropea d4677a2c2e Added tests for:
- Inner layer that doesn't exist
- Technical layers
- Wrong layer group/spec
2020-07-08 23:34:45 -03:00
Salvador E. Tropea 995b6990aa Added HPGL and PS autoscaling tests.
Added test for example in a dir that must be created.
Removed code not used in docstring trim.
2020-07-08 23:16:04 -03:00
Salvador E. Tropea 8f17733354 Added PS autoscale and --example -p without PCB tests. 2020-07-08 22:55:41 -03:00
Salvador E. Tropea 42342236da Added test fro KiBoM with variant and print_sch_pdf fail. 2020-07-08 22:42:24 -03:00
Salvador E. Tropea 05460f4541 Added test for wrong boolean 2020-07-08 21:06:35 -03:00
Salvador E. Tropea 1917b4c601 Added more tests for errors 2020-07-08 20:41:16 -03:00
Salvador E. Tropea 307bed3a36 Added more preflight tests 2020-07-08 19:49:33 -03:00
Salvador E. Tropea 38baa62cbe Fixed ERC/DRC error count report. 2020-07-08 19:28:07 -03:00
Salvador E. Tropea 4869ead2eb Added test for failling DRC 2020-07-08 16:52:53 -03:00
Salvador E. Tropea 4111131008 Added test for run_erc not boolean. 2020-07-08 16:47:07 -03:00
Salvador E. Tropea 922b853084 Fixed ignore_unconnected.
Also added a test and a test for the error type.
Additionally the BasePreflight now provides default run/apply members.
2020-07-08 16:29:30 -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 45ecb1d02a Added a mechanism to specify suboptions.
Now the legacy drill.map.type and drill.report.filename are specified in this
way.
The BaseOutput class now inherits from Optionable.
Suboptions are just Optionable classes.
Also: added traceback print when an error is reported and we are in debug mode.
2020-07-05 12:40:57 -03:00
Salvador E. Tropea ee11ecf8e7 Added number, variant, conf and separator KiBoM options. 2020-07-02 23:30:57 -03:00
Salvador E. Tropea b48998bb86 Applied abspath to the output path to make is cleaner. 2020-07-02 23:29:53 -03:00
Salvador E. Tropea 25730bce39 Added a note about inner layer names in the README.md
After analyzing all the forks I found that at least 6 forks tried to fix the
Inner.X vs InX.Cu difference.
Also one seems to add support for the names used by pcbnew, but breaks
compatibility with old config files.
2020-07-02 17:19:04 -03:00
Salvador E. Tropea 4538236574 Now outputs and preflights are loaded as plugins.
They can be added from ~/.config/kiplot/plugins/
Also sorted the preflights in the YAML example and allower -v for
--help-list-outputs, needed to know from where are the plugins loaded.
2020-07-02 12:30:30 -03:00
Salvador E. Tropea 1ca21efe94 Now the docstring for string options can specify a list of allowed values
This reduces the number of setters/getters we need to write.
On the other side the time to validate the YAML is increased.
2020-07-02 09:25:06 -03:00
Salvador E. Tropea ec35d2443f Added option to copy plot options from the PCB to the YAML example.
Also added DXF.metric_units and updated the README.
2020-07-01 20:43:03 -03:00
Salvador E. Tropea 3685e3cb8b Enforced a limit to line_width [0.02,2] mm 2020-07-01 11:21:25 -03:00
Salvador E. Tropea 3a1d5d0652 Added pen_number and pen_speed HPGL options 2020-07-01 11:11:33 -03:00
Salvador E. Tropea be8339ddff Added tests to cover all the out_any_drill.py errors. 2020-06-30 22:57:59 -03:00
Salvador E. Tropea d926a5419e Added --example basic tests
Also added support for output directory to --example
2020-06-30 20:43:42 -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 f579d648bf Added check for string in outputs.drill.map/report.
Also support 'None' as Python None.
2020-06-30 19:59:21 -03:00
Salvador E. Tropea 60a2649c0f Moved the dril_marks attribute to a separated class.
Reused by 5 output classes.
2020-06-29 20:10:40 -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 017f2ace47 Fixed redundant "Supported outputs" in the README and updated command line help 2020-06-29 12:57:06 -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 ef4b2f8f95 Regenarte the README.md when we run the linter. 2020-06-29 12:52:14 -03:00
Salvador E. Tropea adb9e26750 Added examples of problems using Coverage.py with macros. 2020-06-27 20:38:16 -03:00
Salvador E. Tropea 7cd0afcdb9 Excluded from coverage code in macros.py that we aren't using.
This code covers cases that we aren't using.
2020-06-27 19:18:32 -03:00
Salvador E. Tropea a436aea8e7 Now the README.md is sychronized using the help output.
The --help-outputs and --help are embedded in the README.md
To make it easier to read now options are enclosed in `` and the list of
outputs is sorted.
2020-06-27 18:28:05 -03:00
Salvador E. Tropea c82c2f0c39 Added support for all the missing IBoM options.
Note that variants_blacklist and variants_whitelist needs a fresh IBoM.
These options didn't work and crashed IBoM. It was reported as a result of
the tests included in this commit.
2020-06-27 15:04:35 -03:00
Salvador E. Tropea d48f258c33 Added tests for the various help options. 2020-06-26 14:48:40 -03:00
Salvador E. Tropea c049d8f9ef Excluded docopt.py from coverage. 2020-06-26 14:48:05 -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 7726732df9 Created a decorator to register the preflight options 2020-06-26 14:45:33 -03:00
Salvador E. Tropea 2f0f3f755d Changed the command line parser from argparse to docopt.
This make the code cleaner and better documented.
Now the usage is more clear, and also a little bit more strict.
I'm using a modified docopt because I preffer using args.option instead of
args['--option'], I also fixed a few flake8 issues in docopt.py.
2020-06-26 12:04:56 -03:00