Commit Graph

161 Commits

Author SHA1 Message Date
Salvador E. Tropea 0c38aa2c64 [Fixed] Config can also raise PlotError
So now is catched
2024-01-16 07:31:59 -03:00
Salvador E. Tropea db8acd1258 [Quick Start][Fixed] Problems scanning dirs without enough privileges 2024-01-15 11:17:39 -03:00
Salvador E. Tropea e64b3864b4 Unified the "run_command" mechanism
- Now most code calls kiplot.run_command
2024-01-08 11:25:48 -03:00
Salvador E. Tropea 2ba5b7101c Unified some *dont_stop* cases 2024-01-05 13:18:03 -03:00
Salvador E. Tropea 190dc0a389 Unified the exit point for errors running external commands 2024-01-05 12:52:46 -03:00
Salvador E. Tropea 9b87aabd9b [Fixed] KiPlotConfigurationError is more specific than KiPlotError 2024-01-05 07:59:10 -03:00
Salvador E. Tropea 7ec3a1379c Unified some errors details
- Non-critical errors will stop when using -W
- More stack traces on error
- More centralized exit
2024-01-04 13:58:13 -03:00
Olliver Schinagl 493c74abff kiplot: Allow output dir to exist
When running kibot with `--out-dir /my_path/reports`, contrary to other
means of running kibot, we check if a path exists. However, this seems
to fail with for example symlinks, resulting in the following error.

Using SCH file: 1.kicad_sch
- 'Records information about the current run.' (info) [info]
Traceback (most recent call last):
  File "/usr/bin/kibot", line 33, in <module>
    sys.exit(load_entry_point('kibot==1.6.3', 'console_scripts', 'kibot')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kibot/__main__.py", line 520, in main
    generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre, args.cli_order, args.no_priority,
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 527, in generate_outputs
    _generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority, dont_stop)
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 517, in _generate_outputs
    run_output(out, dont_stop)
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 418, in run_output
    out.run(get_output_dir(out.dir, out))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 366, in get_output_dir
    os.makedirs(outdir)
  File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists: '/my_path/reports'

Instead of manually determining things, lets just use os.makedirs to
handle this with the `exists_ok` argument, as we do elsewhere.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-01-02 10:53:27 -03:00
Salvador E. Tropea e4614e7603 Now we use the realpath instead of the user provided name
Helps to avoid unpleasant surprises like in the #544 case

Closes #544
2024-01-02 10:48:06 -03:00
Salvador E. Tropea 0feb739edf [Quick Start][Changed] To use only projects
- This avoids problems for sub-sheets in separated dirs.
2024-01-02 10:19:20 -03:00
Salvador E. Tropea 623231be8d [Fixed] Missing implementation of include_components_from_pcb 2023-11-17 10:43:03 -03:00
Salvador E. Tropea a142a76585 [Fixed][KiCad 5] No footprint properties are available 2023-11-16 13:05:57 -03:00
Salvador E. Tropea ff03417926 [Fixed] Missing data in components added from PCBs 2023-11-16 11:24:23 -03:00
Salvador E. Tropea a53f123939 [Variants and Filters] Include components from the PCB
When a component is in the PCB, but not in the schematic, it can be
now processed by the filters.
2023-11-16 09:01:10 -03:00
Salvador E. Tropea d06dbbdf78 Avoid warnings about KiKit auxiliary footprints
They will never be part of the schematic, even when they aren't marked
as excluded from the schematic
2023-11-15 12:51:40 -03:00
Salvador E. Tropea a398b7b0bc [Position][Fixed] Problems when using NET_NAME(n) for a value
Fixes #511
2023-11-08 10:13:32 -03:00
Salvador E. Tropea 92ea7ea193 [Added] Message to clarify which KiCad 5 files are mixed
with the KiCad 6+ files
2023-09-04 13:43:07 -03:00
Salvador E. Tropea 49973b49cb [Flake8] Small changes suggested by flake8 5.0.4 2023-08-11 13:33:54 -03:00
Salvador E. Tropea 67ae12bf1d Made shlex.join use optional
Introduced in Python 3.8
2023-08-08 11:19:47 -03:00
Salvador E. Tropea 22248c0068 [Fixed] Copy of KiCost data
Now we use a copy of the components to allow field expansions.
So we must also copy the specs to the original components.
2023-07-31 13:10:40 -03:00
Salvador E. Tropea 055e832670 [BoM][Added] Support for ${field} expansion
Closes #471
2023-07-31 11:15:37 -03:00
Salvador E. Tropea 0fa7b92039 [Quick-Start] No longer use dedicated templates
- Now we use the internal templates
- This is because now they can be configured
2023-06-14 13:24:08 -03:00
Salvador E. Tropea d6e008ff48 [PCB][Added] Invalidate the text variables cache
- Only when `set_text_variables` is used
- Can be controlled by global option `invalidate_pcb_text_cache`
- Not even the KiCad developers agree about if the cached
  values should be reset or not, see
  https://gitlab.com/kicad/code/kicad/-/issues/14360
  But if we don't reset them the user will think KiBot is failing
  to set them.
  As using `set_text_variables` is a clear intention of change
  I think this is the right behavior.

Closes #441
2023-05-18 10:47:23 -03:00
Salvador E. Tropea 577acfe574 Added stack trace to various exit cases 2023-05-16 10:56:13 -03:00
Salvador E. Tropea 6be9cbecef [Filters][Added] `spec_to_field`
- To extract information from the distributors specs and put in fields.
  I.e. RoHS status.
2023-05-05 11:25:34 -03:00
Salvador E. Tropea 6feddd06a5 [Added] Mechanism to install fonts and colors 2023-04-04 13:49:21 -03:00
Salvador E. Tropea a9ca2f3f11 [Makefile][Fixed] don't skip all preflights on each run
- Just the ones we generate as targets.

Fixes #405
2023-03-18 18:41:15 -03:00
Salvador E. Tropea d656b338b2 Abort when a .sch and .kicad_sch of the same name are detected
Closes #397
2023-03-02 11:11:43 -03:00
Salvador E. Tropea 6fd97254ad [PCB Print][Fixed] KiCad crashing on some complex filled zones
- We must rebuild the conectivity data after a zone fill

Fixes #396
2023-02-27 10:30:11 -03:00
Salvador E. Tropea fe26f1ab6a Problems to detect the SCH under very particular constraints
Fixes #394
2023-02-22 13:04:45 -03:00
Salvador E. Tropea b7897baf87 Added KiConfError error handling during output generation 2023-02-09 09:12:21 -03:00
crides 6b89f42399 don't show warning if footprint has attribute "not in schematics" 2023-01-30 08:43:33 -03:00
Salvador E. Tropea 87aa2565d0 Moved some repeated code to kiplot.py 2023-01-24 16:13:16 -03:00
Salvador E. Tropea e182ab75b8 Added debug for case sensitive differences in file name
Related to #366
2023-01-18 13:50:21 -03:00
Salvador E. Tropea eb8c04f870 [Blender Export] Added Blender render
- Impressive quality thanks to the pcb2blender plug-in
2023-01-16 23:42:52 -03:00
Salvador E. Tropea bda5c159ae [Quick-Start] Changes in variants use
- Avoid importing PCB/SCH stuff that isn't needed
- We no longer use variants in Quick-Start, just filters
2023-01-05 14:16:19 -03:00
Salvador E. Tropea d274ada385 [Quick-Start] Recycled the templates for gerbers
- Now we use the internal templates for the Gerber examples
2023-01-05 13:08:49 -03:00
Salvador E. Tropea 745e8758ad Added correct detection for unknown outputs/groups inside groups 2023-01-05 08:37:55 -03:00
Salvador E. Tropea 17aacf8daf [Added] Support for `groups` of `outputs` 2023-01-04 08:38:21 -03:00
Salvador E. Tropea 12b3f1e5de Simplified exec_with_retry use
- No need to call remove_temporals
- We keep temporals when using debug and got a crash
- Temporals removed on crash
- We inform is temoprals were kept
2023-01-03 11:29:45 -03:00
Salvador E. Tropea f7b9092a2a Simplified the KiAuto use
- Temporal video remove
- Other temporals
- Messages on execution error
2023-01-03 10:04:44 -03:00
Salvador E. Tropea 41c5701d33 [sub-PCB] Avoided saving the PCB before separate
- Now isn't needed because we filter stuff after it
2022-12-27 09:07:33 -03:00
Salvador E. Tropea 7d8cadd0f4 [Stencil*] Now using Xvfb 2022-12-02 19:24:19 -03:00
Salvador E. Tropea 44c7b95e77 [Makefile][Fixed] What is included in all target
- Now outputs marked with run_by_default=False aren't included.
- They are included in other targets, just not in the default
  target.
2022-12-02 13:45:43 -03:00
Salvador E. Tropea 8ec4d481c0 [Package] Moved all resources to a central place
- All KiBot resources are now under kibot/resources
- PcbDraw resources are now in kibot/resources/pcbdraw
- All resources can be loaded relative to the script or from
  /usr/share/kibot
- The Debian package installs the resources in /usr/share/kibot
- The Python manifest includes all resources
- PcbDraw is now detected as a Python package
2022-10-19 13:05:56 -03:00
Salvador E. Tropea 701824e4e4 Removed spurious KiCad messages during KiCad 5 PCB loads
- Seen on KiCad 6
2022-10-18 10:59:36 -03:00
Salvador E. Tropea a337028007 [Internal BoM] Added some basic support for "Exclude from BoM" flag
Related to #316
2022-10-11 11:46:00 -03:00
Salvador E. Tropea 63b4c526f8 Fixed missing XYRS information for components with multiple units
Closes #306
2022-09-29 07:54:32 -03:00
Salvador E. Tropea 9c1d32fac3 [Debug] Added place where we use run_command 2022-09-27 11:01:44 -03:00
Salvador E. Tropea 1f1a56e5ac Added support for changing text variables with variants
- During outputs creation.
- Option `set_text_variables_before_output`.

Related to #233
2022-09-12 13:35:40 -03:00