michaldaniel / ebook-viewer Goto Github PK
View Code? Open in Web Editor NEWModern GTK Python Ebook Reader app to easily read epub files
License: GNU General Public License v3.0
Modern GTK Python Ebook Reader app to easily read epub files
License: GNU General Public License v3.0
Hi, don't normally use git hub much so I hope I'm not abusing the purpose posting here.
I like the, simple, clean, visually appealing reader you've created. Thank you. I know you plan on creating formating controls like variable font options.
I wanted to suggest, as it seems to be an oversight in many other desktop based readers, variable margins. So that at full screen/maximised you don't have to scan the full screen width each line.
I'm sure you've already considered it.
I thought if I made changes to the CSS file it would effect the changes i'd like for me but when i alter it nothing seems to happen.
It would be nice if the config was saved into XDG_CONFIG_HOME
or just into ~/.config/easy-ebook-viewer
instead of ~/.easy-ebook-viewer.conf
On Ubunut 16.10
Title.
i have some books in text format, and your view page looks beautiful, so i am wondering if it can read text files.
The app is great and I wish I could set it as a default app to open epub, however, it doesn't work - the app opens when I double click an epub file in Nautilus but the file is not loaded.
As mentioned in #5.
When clicking the "Import book" menu item, an error message pops up ("Importing is unavailable - Importing requires Calibre eBook reader to be installed."). This dialog window can't be dismissed - when I click "OK", the main window is not dimmed any more, but the dialog stays open.
System information: Arch Linux, installed ebook-viewer package a few minutes ago using the PKGBUILD from #10. gtk3
package version 3.22.4-1.
wouldn't it be convenient if this package would be available in a repository so it would be easily installed and uninstalled?
Thankyou,
Jigar Wala
Currently, this application can’t be translated. Please consider using a framework like Gettext so that translators can provide localized UI files in the future :)
Beginner Python programmer, don't have the skills/knowledge to follow the install instructions. Any help much appreciated. Specifically:
Installing
Requires: gir1.2-webkit-3.0, libwebkitgtk-3.0-0, gir1.2-gtk-3.0, python3-gi (PyGObject for Python 3)
Questions:
Where do I find these?
How do I install them in my system (e.g. with pip? other method?)
Download or clone this repository then run in project directory:
sudo make install
Questions:
How do I "download this repository" from github?
What is meant by "in project directory"? How do I get to the project directory to run sudo make install?
Thanks again for any advice.
I tried with several epubs, but none is opened correctly. I see a black background, with only images showing correctly (all spaced like the text was really there, just I cannot see it). No errors are displayed.
You can try for example this Open epub from project gutenberg: http://www.gutenberg.org/ebooks/53979 (ebook with images).
I'm on archlinux, using this pkgbuild: https://aur.archlinux.org/packages/ebook-viewer-git/
Python 3.6
Webkit 2.4.11
Gobject introspection 1.50.0+1+gb8d92b0
Please tell me if more info are needed
Bug:
While creating a window and working, current build throws
GLib-GIO-CRITICAL **: g_application_set_application_id: assertion 'application_id == NULL || g_application_id_is_valid (application_id)' failed
Proposed solution:
Change [main.py:27] application_id="easy-ebook-viewer"
to application_id="linux.easy-ebook-viewer"
or whatever, as long as the ID contains two (2) parts separated by a dot.
https://developer.gnome.org/gio/stable/GApplication.html#g-application-id-is-valid
So I won't forget this tomorrow: if you jump from first to last page both left and right arrows stay inactive.
Hi, sorry for bothering you with another issue. This time, by taking a quick look at traceback, seems to be related with the book not having the authors name. When trying to open this book from the file manager the program window doesn't appear, and when trying to open using the "Please choose a file" dialog nothing from the book would show up. In the terminal I got this error:
Traceback (most recent call last): File "/usr/share/easy-ebook-viewer/components/header_bar.py", line 229, in __on_open_clicked self.__window.load_book_data(filename) File "/usr/share/easy-ebook-viewer/main_window.py", line 331, in load_book_data self.__continiue_book_loading(filename) File "/usr/share/easy-ebook-viewer/main_window.py", line 279, in __continiue_book_loading if self.content_provider.prepare_book(filename): File "/usr/share/easy-ebook-viewer/workers/content_provider.py", line 89, in prepare_book self.book_name = str(bytes.decode(str(metadata.metadata.dc_title).encode("utf-8"))) AttributeError: 'NoneType' object has no attribute 'dc_title'
If you want, I can send the ebook for you have a better look at it.
I tried opening several ePub books, with limited success. Some can be displayed just fine while others cannot (the main window remains empty, with no content). Calibre can open them instead. Unfortunately I cannot share those e-books publicly, but I'm happy to send them to you in private (e-mail?) if you want.
Hi! I got a reference to your e-book viewer from a post on instagram. I see that your repo is unfortunately not being maintained anymore. Could you mark it as archive to to limit confusion?:)
Best regards
I have an ebook that when opened with ebook-viewer ends with files in the wrong order.
You can test it with this epub I created in sigil.
Change the extension to .epub
: test.txt
Edit: In the meantime, I did this change using "spine". It works for me™.
diff --git a/src/workers/content_provider.py b/src/workers/content_provider.py
index 691c93b..0fc91b7 100644
--- a/src/workers/content_provider.py
+++ b/src/workers/content_provider.py
@@ -198,11 +198,17 @@ class ContentProvider:
ncx_file_path = self.__get_ncx_file_path
metadata = self.__get_metadata
__files = []
+ __files_id = []
self.chapter_links = []
chapter_order = []
for x in metadata.manifest.item:
if x.media_type == "application/xhtml+xml":
__files.append(x.href)
+ __files_id.append(x.id)
+
+ spine_ids = []
+ for x in metadata.spine.itemref:
+ spine_ids.append(x.idref)
self.titles = []
if os.access(ncx_file_path, os.R_OK): # Checks if NCX is accessible
@@ -247,14 +253,12 @@ class ContentProvider:
for i in range(len(self.titles)):
self.titles[i] = [self.titles[i], self.chapter_links[i]]
- # If not all all files are chaptered append them
- # chater_number = 1;
- if len(__files) > len(self.chapter_links):
- for i in range(len(__files)):
- if __files[i] not in self.chapter_links:
- self.chapter_links.insert(i, __files[i])
- # self.titles.insert(i, "Unnamed chapter" + " (" + str(chater_number) + ")")
- # chater_number += 1;
+ # Rebuild chapter_links
+ self.chapter_links = []
+ if len(spine_ids) > len(self.chapter_links):
+ for i in range(len(spine_ids)):
+ if spine_ids[i] in __files_id:
+ self.chapter_links.append(__files[__files_id.index(spine_ids[i])])
# Print some debug
print("Files: " + str(__files))
G'day Michal,
For your interest, I'm maintaining another viewer, the Read activity at Sugar Labs, which is bundled on the One Laptop per Child laptops. Our viewer like yours is Python GTK+ and uses WebKit to render EPUB files, and also uses Evince to render PDF files. See User Manual.
We're faced with the impending doom of obsolescence of the WebKit 3.0 API. Are you planning a port to WebKit2 4.0 API?
I just wanted to say thank you but there was no other option to do so. That was one thing I missed from Windows - a decent epub reader, the other VirtualDub. The app is great and I wish I could set it as a default app to open epub, however, it doesn't work - the app opens when I double click an epub file in Nautilus but the file is not loaded. Anyway, thank you and keep up the good work!
Hi,
can you take a look?
gino@gino-xps13:/tmp$ easy-ebook-viewer
Traceback (most recent call last):
File "/usr/share/easy-ebook-viewer/main.py", line 20, in <module>
from main_window import MainWindow
File "/usr/share/easy-ebook-viewer/main_window.py", line 21, in <module>
from components import header_bar, viewer, chapters_list
File "/usr/share/easy-ebook-viewer/components/viewer.py", line 19, in <module>
gi.require_version('WebKit', '3.0')
File "/usr/lib64/python3.5/site-packages/gi/__init__.py", line 118, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace WebKit not available
Best regards
Gino
It would be nice if we have a deb or PPA, so that we don't have to go through the trouble of compiling.
is this app available on arch linux or slackware ?
For the GUI to have a consistent look across different icon themes, you should stick with either the symbolic icon set (as is recommended for GNOME applications) or the regular icon set.
In header-bar.py
for instance, it seems that you're using (perhaps unintentionally) a mix of symbolic and regular icons.
I would recommend changing the header-bar to use only symbolic icons. Problematic lines include:
49 document_open_image = Gtk.Image.new_from_icon_name("document-open", Gtk.IconSize.LARGE_TOOLBAR)`
139 document_properties_image = Gtk.Image.new_from_icon_name("open-menu", Gtk.IconSize.LARGE_TOOLBAR)`
Simply append -symbolic
to each icon name listed above to resolve the issue.
I have a fresh install of Ubuntu 19.04 and once installed all dependencies this error is raised on every launch:
easy-ebook-viewer
Traceback (most recent call last):
File "/usr/share/easy-ebook-viewer/main.py", line 21, in <module>
from main_window import MainWindow
File "/usr/share/easy-ebook-viewer/main_window.py", line 21, in <module>
from components import header_bar, viewer, chapters_list
File "/usr/share/easy-ebook-viewer/components/viewer.py", line 19, in <module>
gi.require_version('WebKit', '3.0')
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace WebKit not available
It would be cool to be able to show the index of a book (list of chapters).
It would be nice to set a particular directory to be scanned and viewed as the library. This would enable the following features:
I'll do my best to work on this feature and push it.
The binary actually replaces or gets replaced by calibre's ebook-viewer. This would create a conflict if you want it packaged for any distribution.
How to reproduce:
Ubuntu 16.04 x64.
Terminal output from the broken window:
Chapter count: 201
Loaded: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_048.html
Loaded: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_048.html
Loaded: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_049.html
Loaded: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_048.html
Could not read: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_049.html
Could not read: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_048.html
Could not read: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_049.html
Could not read: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_050.html
Could not read: /tmp/easy-ebook-viewer-cache-user/index_split_000_split_051.html
Debugging:
Note:
The application (version 1.0-g09995b1) fails opening this eBook:
user@box ~ $ easy-ebook-viewer VMware-por-vExperts-libro.epub
(main.py:28993): GLib-GIO-CRITICAL **: g_application_set_application_id: assertion 'application_id == NULL || g_application_id_is_valid (application_id)' failed
Displaying blank page.
Traceback (most recent call last):
File "/home/diego/Projects/Ebook-Viewer/src/main.py", line 54, in do_activate
self.window = MainWindow(file_path=self.file_path)
File "/home/diego/Projects/Ebook-Viewer/src/main_window.py", line 113, in __init__
self.load_book_data(sys.argv[1])
File "/home/diego/Projects/Ebook-Viewer/src/main_window.py", line 327, in load_book_data
self.__continiue_book_loading(filename)
File "/home/diego/Projects/Ebook-Viewer/src/main_window.py", line 275, in __continiue_book_loading
if self.content_provider.prepare_book(filename):
File "/home/diego/Projects/Ebook-Viewer/src/workers/content_provider.py", line 123, in prepare_book
self.__load_titles_and_files()
File "/home/diego/Projects/Ebook-Viewer/src/workers/content_provider.py", line 208, in __load_titles_and_files
if os.access(ncx_file_path, os.R_OK): # Checks if NCX is accessible
TypeError: access: can't specify None for path argument
I've just installed easy-ebook-viewer and I'm really happy with it. I had been looking for an epub viewer for a long time, and couldn't find one that just showed the text + index, quickly and well, the way that EEV does. I wonder if there are any keyboard shortcuts, particularly to toggle showing/hiding the index ?
EDIT 1: The only shortcut I've discovered is which jumps to the next page. I couldn't find how to scroll one line down or up, or just scroll a screenful.
libwebkitgtk-3.0 is deprecated and no longer used in many modern distro.
It's dependencies are also huge, requiring around 1.8 Gb of space on disk.
Ebook-Viewer should move to webkitgtk2-4.0
I had to install calibre in order to import a book is this normal?
I just noticed an error on line 27 in main.py.
https://developer.gnome.org/gio/stable/GApplication.html#g-application-id-is-valid
Basically just missing a dot.
Hi, I have all the 3 dependencies and used the sudo make install
but I couldn't get it to run. Opening as a default app in a epub file doesn't even show the program window and using it in terminal gave me this error below. Any known issues with Linux Mint or Ubuntu 14.04?
Traceback (most recent call last): File "/usr/share/easy-ebook-viewer/main.py", line 28, in <module> win = MainWindow() File "/usr/share/easy-ebook-viewer/main_window.py", line 59, in __init__ self.header_bar_component = header_bar.HeaderBarComponent(self) File "/usr/share/easy-ebook-viewer/components/header_bar.py", line 38, in __init__ self.__populate_headerbar() File "/usr/share/easy-ebook-viewer/components/header_bar.py", line 61, in __populate_headerbar self.current_page_entry.set_max_width_chars(3) AttributeError: 'Entry' object has no attribute 'set_max_width_chars'
On Ubuntu 17.04, gir1.2-webkit-3.0 is required install before it runs. It should probably be added to the readme.
It would be nice if we have a AUR pkg, so that we don't have to go through the trouble of compiling :).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.