KiCad automation utility
Go to file
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
.github Merge branch 'dev' into kiri_integration 2023-12-22 08:29:17 -03:00
debian [KiRi] Added resources to the distro 2024-01-02 10:10:51 -03:00
docs [KiRi][DOCs] Updated 2023-12-29 13:21:17 -03:00
experiments [Experiments] Added mechanism to supress 20% fake color band 2023-03-20 14:14:00 -03:00
info/KiCad
kibot kiplot: Allow output dir to exist 2024-01-02 10:53:27 -03:00
src [KiRi][DOCs] Added generated docs and deps 2023-12-06 13:50:33 -03:00
submodules [KiCost] Updated submodule to get f3c1da5aa59d669d927ee43d386bb955e8e5ee10 2023-05-12 13:48:27 -03:00
tests [Tests][Fixed] Quick Start test 2024-01-02 10:46:45 -03:00
tools [CI/CD][Added] Experimental meta data to the dev images 2023-12-06 12:31:10 -03:00
.bandit
.coveragerc [Tests] Excluded PcbDraw and blender_scripts from coverage 2023-04-18 07:54:19 -03:00
.gitignore Added test cache for 3D models 2023-01-27 12:20:51 -03:00
.gitmodules [Package] Moved all resources to a central place 2022-10-19 13:05:56 -03:00
.pre-commit-config.yaml [Tests] Adapted to the new behavior 2023-11-16 11:20:24 -03:00
.readthedocs.yaml [DOCs][RTD] Added job to find defined variables 2023-08-29 09:56:37 -03:00
.yamllint
CHANGELOG.md [Quick Start][Changed] To use only projects 2024-01-02 10:19:20 -03:00
Dockerfile [CI/CD] Updating Github Action v2 for KiCad 7 latest 2023-04-02 08:19:50 -03:00
Dockerfile_dk5 [GHA] Switching to full images 2023-01-27 16:37:13 -03:00
Dockerfile_dk6 [GHA] Switching to full images 2023-01-27 16:37:13 -03:00
Dockerfile_dk7 [GHA] Added KiCad 7 2023-03-16 09:45:29 -03:00
Dockerfile_k5 [GHA] Switching to full images 2023-01-27 16:37:13 -03:00
Dockerfile_k6 [GHA] Switching to full images 2023-01-27 16:37:13 -03:00
Dockerfile_k7 [GHA] Added KiCad 7 2023-03-16 09:45:29 -03:00
LICENSE Changing licence to AGPL v3 2023-02-04 13:14:26 -03:00
MANIFEST.in [KiRi] Added resources to the distro 2024-01-02 10:10:51 -03:00
Makefile [Makefile] Remove cache for full test 2023-08-10 13:12:52 -03:00
README.md [DOCs] Moved to Read the Docs. 2023-08-29 13:12:29 -03:00
action.yml [GHA] Fixed description 2023-04-02 14:59:21 -03:00
entrypoint.sh [GHA] Added ASCII art banner 2023-04-01 09:43:37 -03:00
g1.sh [Tests] Separated independent tests 2023-04-18 07:31:42 -03:00
g2.sh [Tests] Separated independent tests 2023-04-18 07:31:42 -03:00
g3.sh [Tests] Separated independent tests 2023-04-18 07:31:42 -03:00
g4.sh [Tests] Separated independent tests 2023-04-18 07:31:42 -03:00
pytest.ini [Tests] Separated independent tests 2023-04-18 07:31:42 -03:00
setup.cfg Added help for the error levels 2023-08-30 13:59:35 -03:00
setup.py Updated minimum Python version to 3.7 2023-08-08 11:23:17 -03:00

README.md

KiBot (formerly KiPlot)

KiBot Logo

Python application Coverage Status PyPI version DOCs status Donate

KiBot is a program which helps you to generate the fabrication and documentation files for your KiCad projects easily, repeatable, and most of all, scriptably. This means you can use a Makefile to export your KiCad PCBs just as needed, or do it in a CI/CD environment.

For more information consult the documentation (hosted by Read the Docs)

If you want to see an example of what KiBot can generate visit this project