kicad-automation-scripts icon indicating copy to clipboard operation
kicad-automation-scripts copied to clipboard

Does it work with Python3?

Open leoheck opened this issue 5 years ago • 2 comments

I am trying to use it with Ubuntu 20.04 with Kicad 5.1.5 without docker.

Currently trying to solve this

➜ python3 -m src.eeschema.schematic run_erc ../board.sch tmp
INFO:util.ui_automation:Waiting for Project Rescue Helper window...
Initial recording window is set to:
X:0   Y:0    Width:800    Height:600
Adjusted recording window is set to:
X:0   Y:4    Width:800    Height:592
Your window manager appears to be Unknown

Initializing...
Output file: /home/lheck/Dropbox/deepx/HOMEBASE/hardware-misc/homebase-led-flower-panel/kicad-automation-scripts/tmp/run_erc_schematic_screencast-1.ogv
Capturing!
INFO:__main__:Focus main eeschema window
INFO:util.ui_automation:Waiting for eeschema window...
INFO:util.ui_automation:Found eeschema window
DEBUG:util.ui_automation:Window id: b''
INFO:__main__:Inspect->Electrical Rules Checker
   tting down....
Done.
Written 71392 bytes
(71392 of which were video data and 0 audio data)

..
Goodbye!
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/lheck/Dropbox/deepx/HOMEBASE/hardware-misc/homebase-led-flower-panel/kicad-automation-scripts/src/eeschema/schematic.py", line 311, in <module>
    errors = eeschema_run_erc(schematic, output_dir, args.warnings_as_errors, args.junit_xml)
  File "/home/lheck/Dropbox/deepx/HOMEBASE/hardware-misc/homebase-led-flower-panel/kicad-automation-scripts/src/eeschema/schematic.py", line 236, in eeschema_run_erc
    clipboard_store(output_dir)
  File "/home/lheck/Dropbox/deepx/HOMEBASE/hardware-misc/homebase-led-flower-panel/kicad-automation-scripts/src/util/ui_automation.py", line 71, in clipboard_store
    outs, errs = p.communicate(input=string)
  File "/usr/lib/python3.8/subprocess.py", line 1009, in communicate
    self._stdin_write(input)
  File "/usr/lib/python3.8/subprocess.py", line 958, in _stdin_write
    self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
X connection to :1941536710 broken (explicit kill or server shutdown).

leoheck avatar Apr 25 '20 19:04 leoheck

My fork works with Python3. It changed a lot of details, but I hope the README is clear enough: https://github.com/INTI-CMNB/kicad-automation-scripts If you try it and doesn't work please tell me what error are you getting.

set-soft avatar May 07 '20 22:05 set-soft

Yes, I saw your fork, it works really well for me. I saw other forks too. I was trying to figure out how I could get the functionality of many other forks into a single fork/place.

leoheck avatar May 08 '20 00:05 leoheck