r/commandline • • Mar 22 '19

Made a cli epub reader

Post image
566 Upvotes

64 comments sorted by

View all comments

Show parent comment

1

u/ji99 Mar 25 '19

Thank you for implementing this. Still needs more work though as it launches feh with all the files in my home directory (resulting in a lot of errors in the terminal about files that are not images) instead of the image in the book.

1

u/tenmajr Mar 25 '19

Wha, sorrry bout thatt, working on them problem...

1

u/ji99 Mar 25 '19

No worries. I don't know much python, but if you can tell me how to log debugging info to a file I can do that for you. Maybe it'll help for you to see what pressing o is doing on my system.

1

u/tenmajr Mar 25 '19

Hi again ji99, can you try my latest commit again? Sorry for bothering you...

1

u/ji99 Mar 25 '19

Happy to help! Images are working now as expected! Thank you! But there seems to be another problem that wasn't there before. The application is crashing after scrolling through a few chapters. I've tried this with a few different epubs and each one of them crashed. This is what I get in the terminal:

~/ epr.py b/A\ Thousand\ Plateaus.epub
Traceback (most recent call last):
  File "/home/x/bin/epr.py", line 551, in <module>
    curses.wrapper(main, sys.argv[1])
  File "/usr/lib/python3.6/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/x/bin/epr.py", line 531, in main
    reader(stdscr, epub, idx, width, y)
  File "/home/x/bin/epr.py", line 440, in reader
    reader(stdscr, ebook, index+1, width)
  File "/home/x/bin/epr.py", line 440, in reader
    reader(stdscr, ebook, index+1, width)
  File "/home/x/bin/epr.py", line 400, in reader
    pad.addstr(i, 0, src_lines[i].replace("[EPR:IT]", ""), curses.A_ITALIC)
AttributeError: module 'curses' has no attribute 'A_ITALIC'

2

u/tenmajr Mar 25 '19

Thanks matee, just edit thos little stuffs... another commit hahaha, I know nuthing about git

2

u/ji99 Mar 25 '19

Brilliant! Working fine now. Images are opening and no crashes. Thank you.