txoof / PaperPi

E-Paper display loop with plugins
104 stars 10 forks source link

find_imports.sh kicks errors when processing slideshow #75

Closed txoof closed 1 year ago

txoof commented 1 year ago
INFO: Successfully saved requirements file in ../paperpi/plugins//slideshow/requirements-slideshow.txt
Traceback (most recent call last):
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/bin/pipreqs", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 488, in main
    init(args)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 478, in init
    generate_requirements_file(path, imports, symbol)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 157, in generate_requirements_file
    with _open(path, "w") as out_file:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 81, in _open
    file = open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '../paperpi/plugins//slideshow.image_only_centered_blackbkground-sample.png/requirements-slideshow.image_only_centered_blackbkground-sample.png.txt'
sed: can't read ../paperpi/plugins//slideshow.image_only_centered_blackbkground-sample.png/requirements-slideshow.image_only_centered_blackbkground-sample.png.txt: Not a directory
Traceback (most recent call last):
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/bin/pipreqs", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 488, in main
    init(args)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 478, in init
    generate_requirements_file(path, imports, symbol)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 157, in generate_requirements_file
    with _open(path, "w") as out_file:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 81, in _open
    file = open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '../paperpi/plugins//slideshow.image_only_centered_whitebkground-sample.png/requirements-slideshow.image_only_centered_whitebkground-sample.png.txt'
sed: can't read ../paperpi/plugins//slideshow.image_only_centered_whitebkground-sample.png/requirements-slideshow.image_only_centered_whitebkground-sample.png.txt: Not a directory
Traceback (most recent call last):
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/bin/pipreqs", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 488, in main
    init(args)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 478, in init
    generate_requirements_file(path, imports, symbol)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 157, in generate_requirements_file
    with _open(path, "w") as out_file:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 81, in _open
    file = open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '../paperpi/plugins//slideshow.image_time_centered_blackbkground-sample.png/requirements-slideshow.image_time_centered_blackbkground-sample.png.txt'
sed: can't read ../paperpi/plugins//slideshow.image_time_centered_blackbkground-sample.png/requirements-slideshow.image_time_centered_blackbkground-sample.png.txt: Not a directory
Traceback (most recent call last):
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/bin/pipreqs", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 488, in main
    init(args)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 478, in init
    generate_requirements_file(path, imports, symbol)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 157, in generate_requirements_file
    with _open(path, "w") as out_file:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 81, in _open
    file = open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '../paperpi/plugins//slideshow.image_time_centered_whitebkground-sample.png/requirements-slideshow.image_time_centered_whitebkground-sample.png.txt'
sed: can't read ../paperpi/plugins//slideshow.image_time_centered_whitebkground-sample.png/requirements-slideshow.image_time_centered_whitebkground-sample.png.txt: Not a directory
Traceback (most recent call last):
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/bin/pipreqs", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 488, in main
    init(args)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 478, in init
    generate_requirements_file(path, imports, symbol)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 157, in generate_requirements_file
    with _open(path, "w") as out_file:
  File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 81, in _open
    file = open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '../paperpi/plugins//slideshow.layout-sample.png/requirements-slideshow.layout-sample.png.txt'
txoof commented 1 year ago

This is caused by unneeded .png files lingering in the plugin directory. Need to improve the checks in the script to ignore regular files.

txoof commented 1 year ago

resolved with commit 51e2b577b94a74817aa8cbacaea5de4846654ed3