marianosimone / epub-thumbnailer

Script to extract the cover of an epub book and create a thumbnail for it
GNU General Public License v3.0
191 stars 29 forks source link

Detect gnome version when gnome-session is not available via gnome-shell #9

Closed bobbitybob closed 8 years ago

bobbitybob commented 8 years ago

Getting a traceback on installation:

Installing epub-thumbnailer to /usr/bin/ ...
OK
Traceback (most recent call last):
File "install.py", line 144, in 
commandsargs.action
File "install.py", line 92, in install
environment = check_desktop_env()
File "install.py", line 79, in check_desktop_env
return VERSION_GUSSERS.get(desktop_environment, lambda: None)()
File "install.py", line 60, in gnome_shell_version
major_version = version[1][0]
IndexError: list index out of range

Running from terminal causes another traceback. Maybe related?

$epub-thumbnailer
Traceback (most recent call last):
  File "/usr/bin/epub-thumbnailer", line 24, in <module>
    from StringIO import StringIO
ImportError: No module named 'StringIO'

Running Arch Linux (4.2.5-1-ARCH) with Gnome Version 3.18.2. Anything else you want to know just ask. Thanks. :) Looking forward to getting thumbnails to my epubs. :)

marianosimone commented 8 years ago

Can you run python --version for me?

bobbitybob commented 8 years ago

No probs: Python 3.5.0

marianosimone commented 8 years ago

Ok, I'm fixing the Python3 issues once and for all (?), but I'll have a harder time with the installation, as the environment is very different to what I've got... I might be able to figure it out with one more thing. Could you please run: gnome-session --version?

bobbitybob commented 8 years ago

Thanks for fixing the Python 3 stuff. :) gnome-session --version doesn't produce anything. gnome-shell --version gives GNOME Shell 3.18.3. Don't know if that helps. Like I say, am happy to help with testing. :)

Guess if it's a python script I could run it in my epub folder? Worst case scenario?

marianosimone commented 8 years ago

I added some logic to fall back to using gnome-shell when gnome-session is not available. That might get the installer running for you

bobbitybob commented 8 years ago

Hey Mariano. This issue appears to be solved. Lots more thumbnails being generated. I'll get back to you with any that don't work (if that helps). Thanks for the brilliant support. :)

marianosimone commented 8 years ago

Awesome! Glad to see this solved. I'm always happy to get new epubs for which the thumbnails are not generate and try to improve the logic!

bobbitybob commented 8 years ago

Out of over 3000 epubs only a handful (<20) didn't generate covers. With gnome-epub-thumbnailer this number was more like 50-70%. I've attached a small zip with ones that didn't work. Maybe it can help you. Maybe you should also look at getting gnome to use your program, since it's obviously superior. Thanks again. epub.zip