View Single Post
Old 04-19-2013, 08:09 PM   #1
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
[Device Plugin] Kobo Touch Extended Driver

THIS PLUGIN IS BEING INTERMITTENTLY DEVELOPED! FEATURE REQUESTS AND BUG REPORTS MAY TAKE A FEW DAYS TO BE REPLIED TO.

This plugin enables some additional features for all Kobo devices supported by calibre from the Kobo Touch onwards. ePub books processed with this plugin will be rendered using Kobo's internal kepub renderer instead of the standard ePub renderer.

Please see the README file for the most current details. I will try to keep this post up to date, but the README is always up to date.

The main benefits of using the kepub renderer (which some may prefer not to have) are:
  • Page numbers show the number of page turns remaining in the current chapter instead of the estimated number of pages for the entire book.
    • If you don't want this, there is an option in the driver settings to force full-book page numbers.
  • Reading statistics (time left in this chapter, time for the next chapter, time to complete the book)
  • The book title is shown at the top of each page.
  • The chapter title, if any, is shown at the bottom of each page with the page numbers.

You are encouraged to install these two plugins as well, to ensure KePub metadata is correctly processed when sending to your Kobo device:

Usage
To use this plugin after installing:
  • Connect your Kobo device and wait for it to be detected by calibre
  • Select the book(s) you want to send to your device.
  • Click the Send to device button.

Special Notes
  • This plugin requires calibre 5.0.0 or later!
  • It is recommended that you disable the built-in KoboTouch driver (but not the built-in Kobo driver) while this plugin is installed. On rare occasions, calibre may select the built-in KoboTouch driver instead of this plugin.
  • This device plugin enables access to Kobo features that are written with the expectation that only unmodified Kobo-purchased books will be used. Kobo reserves the right to make any change at any time, including changes that will cause problems with books created using this plugin ranging from minor to severe, without notice.
  • When configuring the plugin, it is not necessary to include the '.kepub' portion of the file name; the plugin will add that automatically.
  • Modified ePub books are not saved to your calibre library in their kepub form; the kepub is only sent to your device, your copy in calibre is never modified.

Installation Directions
Open Preferences -> Plugins -> Get new plugins and install the 'Kobo Touch Extended' plugin. You may also download the attached zip file and install the plugin manually, then restart calibre as described in the Introduction to Plugins thread.
[/SPOILER]

Contributing

Decided you want to contribute to the development of this plugin? Awesome! If you want to contribute to the development of this plugin, you have many options:
  • Contribute code, whether for existing bug reports, for new bugs that you found, or for new features that you really want to see implemented. To contribute code, you may fork the repository and send a pull request, or you may send me a PM here with a Git patch file.
  • Submit bug reports on GitHub. Although I'm happy to discuss the plugin here, I may still ask you to create a bug report; this is so I actually remember to investigate your request!
  • Test pre-released code from GitHub. Between releases, new code is committed and may be installed using directions provided in the README file. Based on your testing, you may submit bug reports, provide feedback, think of new feature requests, or just generally enjoy early access (and not necessarily stable code!) to upcoming versions of the plugin.
  • Translate the plugin on the plugin's Transifex page.


Although I'm generally perfectly happy to discuss possible issues here, any issues sent to me through any means other than the Github bug tracker (including email, PM, etc.) may be silently ignored. This is not because I don't care! It's because I have a terrible memory, the Github issue tracker is my "to-do list" for this plugin, and there's been instances where I've seen a post or PM here and promptly forgotten all about it until I happened to stumble across the post again later. If you aren't sure if you have an issue, feel free to post here and we can work together to decide if you need to make a new Github issue or not. If you are sure you have an issue, or if you have an error or exception from calibre, post a new issue. It isn't necessary to post here when you make a new issue, I get notified of all new bugs and I check the list regularly. The worst that could possibly happen on Github is the same that could happen here: I'll tell you that it's not a bug and you'll have the opportunity to convince me otherwise!

Version History
Spoiler:

Version 3.6.7 - 2023-11-30
Replace long-deprecated and finally removed SafeConfigParser with ConfigParser
Version 3.6.6 - 2023-09-20
Update translations for Spanish (es_ES)
Version 3.6.5 - 2023-08-15
Update translations for Portuguese (Brazil) and Italian
Version 3.6.4 - 2023-07-17
Fix a timeout error that may occur when processing a large number of books.
Version 3.6.3 - 2022-07-31
Fix issues with threading and with calibre 6/QT6 (thanks davidfor!)
Version 3.6.0 - 2022-06-06
Add template for deciding to kepubify (from davidfor)
Version 3.5.4 - 2021-10-31
Update custom CSS files supported to include new devices
Version 3.5.3 - 2021-08-13
Use calibre smartyPants for punctuation smartening
Version 3.5.2 - 2021-07-17
Fix issue with exceptions being thrown in subprocesses
Version 3.5.1 - 2021-07-04
No longer compatible with Python 2
Use a process pool to avoid starting too many threads on massive books (https://github.com/jgoguen/calibre-k...ver/issues/135)
Version 3.4.4 - 2021-01-11
Hopefully fix random disappearing spaces between some words
Version 3.4.3 - 2021-01-05
Fix for non-English locales on Windows failing to load or install the plugin
Version 3.4.2 - 2020-12-30
Fix from davidfor to properly reset the paragraph counter when uploading multiple files
Version 3.4.1 - 2020-10-11
Fix a bug with duplicating koboSpan IDs within a file.
Add options to control hyphenation settings (word length, characters before and after).
Python 2 testing removed.
Version 3.3.0 - 2020-10-09
Make the KePub conversion multi-threaded.
Remove obsolete CSS hyphenation properties.
Version 3.2.15 - 2020-08-21
Adds the specific book to the error message when a conversion fails, and skips <svg> tags and children when adding Kobo spans.
Version 3.2.13 - 2020-07-04
Fix HTML cleanup in the container and exception string processing
Version 3.2.12 - 2020-06-22
Fixes from davidfor for adding a closing </p> in the wrong place
Version 3.2.11 - 2020-06-20
Stop stripping whitespace from the left of each text chunk.
Version 3.2.10 - 2020-06-17
Fix from NiLuJe for more Unicode processing and some misplaced KEPubContainer references.
Version 3.2.9 - 2020-06-17
Fix issue with the logger object not being callable and the conversion adding stray <br> tags
Version 3.2.7 - 2020-05-16
Fix Windows issues with Unicode strings.
Version 3.2.3 - 2020-05-11
Fix logging issue with non-ASCII characters on Windows
Version 3.2.2 - 2020-05-10
Python 3 compatibility - Plugin loads in both calibre and Python 3 calibre beta
Version 3.1.5 - 2019-07-15
Fix settings migrations problems (by davidfor)
Version 3.1.4 - 2019-05-05
Fix exception seen while saving settings (but doesn't appear to block saving)
Version 3.1.2 - 2019-04-30
Fix bad preference migration seen by some people
Version 3.1.0 - 2019-04-21
Remove code to replace book language, which is done by the base driver for new Kobo firmware versions.
Version 3.0.2 - 2017-12-24
Call load_translations where there are translated strings
Version 3.0.1 - 2017-12-03
Fixed an error uploading DRM-encumbered files. Added new translations.
Version 3.0.0 - 2017-10-30
Imported to BitBucket, made small bugfix and formatting changes, new translations
Version 2.8.2 - 2016-09-19
Fix a typo resulting in an always-true error
Version 2.8.0 - 2016-08-20
Fix a problem with hyphenation introduced in version 2.7.0
Update database code to use apsw for increased performance.
Version 2.7.2 - 2016-07-03
Set minimum calibre version to 2.61.0
Version 2.7.1 - 2016-06-26
Spanish (es_ES) translation update
Version 2.7.0 - 2016-06-26
New settings display format
[B]Version 2.6.2 - 2016-05-16
Fix exceptions raised when the spine has files not actually in the book (a.k.a., fixing what the publisher should be fixing)
[B]Version 2.6.1 - 2016-04-13
Fix spaces being removed from some tags
[B]Version 2.6.0 - 2016-04-09
Be more Kobo-like in KePub generation (whitespace between sentences goes at the beginning of the following span)
Version 2.5.3 - 2015-09-30
Fix problem preventing the cover image from being set properly with unusually-set OPF IDs
Version 2.5.2 - 2015-09-23
Fix mangling of file names when saving to the device.
Version 2.5.1 - 2015-08-05
Fix problems with file names not being converted properly
Version 2.5.0 - 2015-08-03
General tweaks and improvements from adding metadata read/write and conversion input
Version 2.3.3 - 2015-02-02
Update style-hacks.css to remove everything except the padding rules
Version 2.3.2 - 2015-01-30
Update to wrap the book text in divs matching Kobo KePubs, with accompanying CSS changes
Version 2.2.19 - 2014-08-13
Fix an issue with text after empty tags being duplicated
Version 2.2.18 - 2014-07-16
Fix an issue with prefs panes not loading properly
Version 2.2.17 - 2014-07-09
Compatibility with upcoming calibre 2
Version 2.2.16 - 2014-05-30
Bug #1324884 - Image tags need to be wrapped in koboSpan tags
Version 2.2.15 - 2014-05-01
Bug #1310967 - properly decode internal content files that are not UTF-8
Version 2.2.14 - 2013-12-20
Translations update
Version 2.2.13 - 2013-11-16
Support Firmware 3.0.0
Version 2.2.12 - 2013-11-08
Bug #1246505 - Stop adding spaces around em-dashes
Add translation support and initial translations
Version 2.2.11 - 2013-10-28
Support database version 89.
Version 2.2.10 - 2013-10-13
Bug #1227733 - Allow choosing the page number format (normal per-chapter or full-book)
Version 2.2.6 - 2013-08-28
Bug #1217488 - Commit container after mainline driver processing
Version 2.2.5 - 2013-08-25
Bug #1216504: Properly handle Processing Instruction and Comment nodes
Version 2.2.4
Bug #1215698 - Fix crashing on first-time plugin configuration
Version 2.2.3 - 2013-08-20
Code restructured to allow sharing as much code as possible with the new conversion output format plugin.
Update to not process books that have already been processed by the conversion output format plugin.
Version 2.1.0 - 2013-08-02
Bug #1205702 - met67 fixed the nested Kobo spans, which appears to resolve highlighting issues.
General updates to support KoboTouch driver changes in calibre 0.9.42
Version 2.0.2 - 2013-07-30
Bug #1206406 - Update hover text for hyphenation
Bug #1206451 - Do not crash when configuring from the Configure This Device option.
Version 2.0.1 - 2013-07-29
Bug #1205976 - Fix crash on non-ePub file upload
Bug #1204730 - Allow easy choice between ePub and KePub upload
Version 2.0.0 - 2013-07-28
Allow the options dialog to be scrollable so people with small screen resolutions don't lose parts of the dialog.
Bug #1202864 - When copying KePub files to a debug directory, use the driver save template to generate the path to copy the book to.
Bug #1197219 - When silently ignoring failed conversions, actually upload the books as ePub instead of teasing the poor end user with suggestive wording.
Add an option to block award tiles from the home screen.
Improve detection of books already converted to KePub to avoid processing a converted book again.
Bug #1204907 - Change hyphenation option to use CSS-based hyphenation. Updated README with new method and directions.
Bug #1205703 - Embed driver details in converted books for improved debugging.
Version 1.5.0 - 2013-07-02
Bug #73 - Fix auto-detection of the ePub cover image
Bug #69 - Add an option to add a DB trigger to disable the ReventBooks tile when processing new books. Applies to side-loaded and Kobo-synced books.
Add an option to add a DB trigger preventing the Kobo analytics DB table from being updated.
Version 1.4.3 - 2013-06-16
Bug #66 - Do not add spaces after punctuation marks where there shouldn't be any.
Bug #68 - Fix issues with multi-line comment nodes being mangled when smartening punctuation.
Version 1.4.2 - 2013-06-09
Support Kobo FW 2.6.1.
Bug #60 - When sanitizing file names, remove all characters prohibited by Windows.
Bug #61 - Parse content files even if they have the wrong content type.
Bug #65 - Fix errors sending books with smarten punctuation enabled.
Do not add the Kobo JavaScript if there is already a kobo*.js file present.
Tighten up logic when detecting cover image without OPF metadata hints.
Do not add Kobo spans to files that already have them.
Force cleanup of invalid markup.
Version 1.4.1 - 2013-05-30
Bug #56 - Remove slashes from names when sending books
Bug #57 - Fix handling of ProcessingInstruction nodes
Bug #58 - Make sure there's actually text to append to
Version 1.4.0 - 2013-05-27
Bugs #48, 52, 53 - Optimize Kobo span generation, significantly reducing file size and DOM complexity.
Bug #54 - Verify that a node has children before trying to reference child nodes.
Bug #55 - Fix issues with adding spaces where there should be none by including the trailing whitespace in the text group regex
Do not consider the semi-colon a full-stop character. It's used for entity encoding.
Version 1.3.3 - 2013-05-22
Bug #42 - Only set the ImageID for books in the current calibre library.
Bug #43 - Allow specifying a directory to copy generated KePub files to (for debugging purposes).
Bug #44 - Don't process ProcessingInstruction nodes like normal nodes, they're special.
Bug #45 - Fix missing text between HTML tags.
Bug #46 - Update ImageID fields in batches to avoid Python query limits.
Bug #47 - Properly account for multi-line text nodes that start with line-break characters.
Bug #50 - Only set the ImageID field when covers are being uploaded.
Fix issues smartening punctuation when HTML comments are present.
Version 1.3.2 - 2013-05-17
Add significantly more Kobo span tags to improve position detection and hopefully fix bookmarks and annotations
Fix issue preventing this plugin from working with calibre 0.9.30 or later on Windows and Mac due to a bug in Python 2.7.4 (Linux users were unaffected)
Version 1.3.1 - 2013-05-09
Firmware 2.5.2 is now supported
Version 1.3.0 - 2013-05-08
Firmware 2.5.1 is now supported
A new option to smarten punctuation during conversion is now available
Spaces are properly added where text is followed by XHTML tags
Error position reporting is improved
Extract Kobo JavaScript from a provided KePub (see the README for details)
Issues resolved detecting where to add Kobo span tags
Version 1.2.7 - 2013-04-17
Fix an issue where the selected node does not always have a parent to be removed from.
Fix an issue where hyphenating removes spaces when HTML tags follow text.
Version 1.2.6 - 2013-04-17
Fix an issue which prevented non-ePub files from being sent to the device
Add progress reporting
Previous versions - Please see the GitHub commit log
Attached Files
File Type: zip KoboTouchExtended.zip (48.3 KB, 8621 views)

Last edited by jgoguen; 11-30-2023 at 09:27 PM. Reason: Fix the github link.
jgoguen is offline   Reply With Quote