ponty/eagexp

Error when running demo

justbuchanan opened this issue · 1 comments

I tried running python -m eagexp.examples.image_example and got the error below. I did some searching and realized that the problem is that eagle is installed in /opt/eagle on my system rather than /usr/share/eagle. Do you know if there's any way to automatically detect the eagle directory so that it can work regardless of where the demos are located? I'm running Arch Linux, btw.

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.5/site-packages/eagexp/examples/image_example.py", line 11, in <module>
    image.export_image(brd, 'api_brd_50.png', resolution=50)
  File "/usr/lib/python3.5/site-packages/eagexp/image.py", line 81, in export_image
    input=input, timeout=timeout, commands=commands, showgui=showgui)
  File "/usr/lib/python3.5/site-packages/eagexp/cmd.py", line 56, in command_eagle
    shutil.copy(input, tmp_input)
  File "/usr/lib/python3.5/shutil.py", line 235, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 114, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: Path('/usr/share/eagle/projects/examples/tutorial/demo2.brd')
ponty commented

eagexp.examples.image_example is just a demo not part of the lib.
It has the eagle board file hardcoded, you can edit it:

brd = '/usr/share/eagle/projects/examples/tutorial/demo2.brd'

The eagle main program is found by the PATH variable.