Code Monkey home page Code Monkey logo

jgoguen / calibre-kobo-driver Goto Github PK

View Code? Open in Web Editor NEW
283.0 17.0 19.0 4.78 MB

An extension of the existing KoboTouch driver provided with Calibre. This plugin allows modifying ePub files to enable extra Kobo features. I am providing code in the repository to you under an open source license. Because this is my personal repository, the license you receive to my code is from me and not my employer.

License: GNU General Public License v3.0

Python 87.29% CSS 0.09% HTML 7.81% JavaScript 0.01% Shell 4.80%
kobo calibre device-driver python driver-plugin conversion kobo-device

calibre-kobo-driver's People

Contributors

allcontributors[bot] avatar davidfor avatar deepsource-io[bot] avatar hub2git avatar jgoguen avatar niluje avatar transifex-integration[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calibre-kobo-driver's Issues

Issue with bookmark and annotation, and book cover

Kobo Glo - ver.2.4.0
Calibre - ver.0.9.23
KoboTouchExtended - ver.2.0.7

I had disable all the device interface plugins and only KoboTouchExtended is enable. Then I had selected send book to device main memory. The book is renamed with the extension .kepub.epub.

The book cover do not appear at first, but after I had transferred another book to device, it show out. But the latest book do not has the cover.

For the annotation - Try highlight, add note or bookmark. Neither information is saved. The sentence/word not highlighted, the page is bookmarked, and the note is added. When relaunch the book, will proceed back to the first page of the latest chapter.

I had checked the html file, the id attribute kobo.X.1 is not in h1-6 and p tags.

I really annoyed with the rendering engine between epub and kepub.epub. Hopefully you able to resolve our problems and save our day.

Thanks alot!

Smarten the punctuation (enhancement)

Can you add a the smart punctuation to the extended menu?
I know it's a standard feature already implemented in Calibre but I don't like using the standard Conversion option as it does "Calibresizes" the output epub with lots of calibre tags that are in mho mostly unnecessary or at least unwanted by me.

To smarten the punctuation of an epub I currently use the "Modify epub" plugin that does this without converting the epub (like Calibre does). This plugin seems to use (call) the default Calibre smarten punctuation routines.

So if you can add the default smarten punctuation routine to your plugin in some future release the whole conversion to kepub can be done in one go.
But do focus first on more important features or bugs that need the fixed or improved first.

Error in parsing some books

I get this error with most of my books:

'utf8' codec can't decode byte 0xc3 in position 51145: unexpected end of data

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 85, in run
File "site-packages/calibre/gui2/device.py", line 551, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 187, in upload_books
File "calibre_plugins.kobotouch_extended.driver", line 148, in _modify_epub
File "calibre_plugins.kobotouch_extended.container", line 77, in get_parsed
File "site-packages/calibre/ebooks/chardet.py", line 30, in strip_encoding_declarations
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 51145: unexpected end of data

Of course the byte value and position varies with files. Some of them are actually working fine.

calibre 64bit Version: 0.9.19 still problem.

Hi
Tried new zip from github but still get error.
calibre, version 0.9.19
ERROR: Unhandled exception: ImportError:cannot import name KOBOTOUCHEXTENDED

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 310, in add_plugin
File "site-packages\calibre\customize\ui.py", line 361, in add_plugin
File "site-packages\calibre\customize\ui.py", line 53, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 167, in load
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.kobotouch_extended.init", line 8, in
ImportError: cannot import name KOBOTOUCHEXTENDED
Any thoughts?
Thanks Michael

Having problems in my comments being accepted so edit first mail
Hi
Seem to have problems in commenting tried 3 times.
Could not update via calibre and gained error message.
Followed your instructions and now have 2.0.5 installed.
Many thanks
Michael

Failed with error: 'this element does not have children or attributes'

Hey it's me again. I just wanted to restore my library on Kobo Glo after a factory reset. Now I am getting the error mentioned in title on a epub file that was definitly sent successfully to device with a previous version of the driver.

Here is the calibre debug log ... hope this helps. ;)

calibre Debug log
calibre 0.9.30 isfrozen: True is64bit: False
Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.4
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Starting up...
Started up in 2.62 seconds with 234 books
Job: 1 Get device information started
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
Job: 2 Get list of books on device started
DEBUG: 0.0 KoboTouch:books - oncard='None'
DEBUG: 0.0 KoboTouch:books - oncard='None', prefix='I:'
DEBUG: 0.0 Kobo device: Kobo Glo
DEBUG: 0.0 Version of driver: (1, 3, 2) Has kepubs: True
DEBUG: 0.0 Version of firmware: (2, 5, 2) Has kepubs: True
DEBUG: 0.0 [u'series', True, True, True, False, True, False, False, False, True, False, u'', True, False, False, False, False, False, False, False]
DEBUG: 0.0 KoboTouch:books - set_debugging_title to ''
DEBUG: 0.0 KoboTouch:books - length bl=0
DEBUG: 0.1 KoboTouch:books - length bl after sync=15
DEBUG: 0.1 KoboTouch:books - reading device database
DEBUG: 0.1 Database Version=78
DEBUG: 0.1 KoboTouch:books - shelf list: [u'Das Lied von Eis und Feuer', u'Ein Fall f\xfcr Carl M\xf8rck, Sonderdezernat Q', u'Shades of Grey', u'Robert Langdon']
DEBUG: 0.1 KoboTouch:books - query= select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, ImageID, ReadStatus, ___ExpirationStatus, FavouritesIndex, Accessibility, IsDownloaded, Series, SeriesNumber, ___UserID from content where BookID is Null and ((Accessibility = -1 and IsDownloaded in ('true', 1 )) or (Accessibility in (1,2) and IsDownloaded in ('true', 1)) ) and not ((___ExpirationStatus=3 or ___ExpirationStatus is Null) and ContentType = 6)
DEBUG: 0.1 KoboTouch:books - about to sync_booklists
DEBUG: 0.1 USBMS: starting sync_booklists
DEBUG: 0.3 USBMS: finished sync_booklists
DEBUG: 0.3 KoboTouch:books - have done sync_booklists
DEBUG: 0.3 KoboTouch:books - end - oncard='None'
DEBUG: 0.3 KoboTouch:books - oncard='carda'
DEBUG: 0.3 KoboTouch:books - Asked to process 'carda', but do not have one!
DEBUG: 0.3 KoboTouch:books - oncard='cardb'
DEBUG: 0.3 KoboTouch:books - Asked to process 'cardb', but do not have one!
DeviceJob: 2 Get list of books on device done, calling callback
DeviceJob: 2 Get list of books on device callback returned
Job: 2 Get list of books on device finished
No details available.
Job: 1 Get device information finished
No details available.
Job: 3 Upload 1 books to device:Die Herren von Winterfell started
Device using plugboard epub KOBOTOUCHEXTENDED None
Setting metadata in: Die Herren von Winterfell at: C:\Users\Manu\AppData\Local\Temp\calibre_3uz33c\gwlribcaltmpfmt.epub
DEBUG: 60.7 KoboTouchExtended:upload_books:Enabling extra ePub features for Kobo devices
DEBUG: 60.7 KoboTouchExtended:_modify_epub:Processing Die Herren von Winterfell
DEBUG: 60.7 KoboTouchExtended:_modify_epub:Failed conversions will raise exceptions
Container:init:Got container path C:\Users\Manu\AppData\Local\Temp\calibre_3uz33c\hfu6th_kobo-driver-extended
DeviceJob: 3 Upload 1 books to device:Die Herren von Winterfell done, calling callback
Failed to parse 'Die Herren von Winterfell' by 'George R. R. Martin' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 511)

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 259, in upload_books
InvalidEPub: Failed to parse 'Die Herren von Winterfell' by 'George R. R. Martin' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 511)

DeviceJob: 3 Upload 1 books to device:Die Herren von Winterfell callback returned
Job: 3 Upload 1 books to device:Die Herren von Winterfell finished
Failed to parse 'Die Herren von Winterfell' by 'George R. R. Martin' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 511)

Traceback (most recent call last):
  File "site-packages\calibre\gui2\device.py", line 85, in run
  File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
  File "calibre_plugins.kobotouch_extended.driver", line 259, in upload_books
InvalidEPub: Failed to parse 'Die Herren von Winterfell' by 'George R. R. Martin' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 511)

Best regards,
SlimShady

No more image cover after 2000 books sent to Kobo

Calibre : 0.9.31
Plugin : Last version posted on GitHub (after correction bug #46)
Kobo Mini : 2.5.2

No more crash when sendig books since bug #46 has been corrected.
Continuing to send books 200 by 200.
After 2000 books sent, no more image cover appear on home page or library list.
Choosing other books to transfer does not solve this.

hyphenation problem

My books are in french. Hyphenation use the wrong dictionnary in every case. Even if i force with calibre (0.9.23) xml:lang="fr" :
html, body {
widows: 0;
orphans: 0;
padding: 0;
margin: 0;
height: 100%;
xml:lang="fr";
}
The convertion in kepub when open with sigil, make appear xml:lang="en" ; making probably use of the wrong hyphenation dictionary in the kobo.
If i edit with sigil the book with xml:lang="fr", i have a bug in the kobo with sometimes a corruption of the db, with a reinitialisation of the firmware mandatory. But even if i substitute the english dictionary with the french one in a KoboRoot.tgz : the wrong hyphenation appear...

Error in the extended Kobo driver while modifying the epub to be a kepub.

Hello,
First of all, my thanks for this nice and very useful plugin.

I've posted this issue on Mobileread : http://www.mobileread.com/forums/showthread.php?t=210894, thinking that it is Calibre's issue.
I got this answer from davidfor : "That is an error in the extended Kobo driver while modifying the epub to be a kepub. The author usually asks for problems to be posted on https://github.com/jgoguen/calibre-kobo-driver. He'll probably need to see the file that is causing the problem".

I'm running on Windows 7 32b.
Here is my problem with Calibre : I'm unable to re-add 2 epubs to my Kobo Glo (which had once been added - before the installation of the plugin- then removed from Kobo)

calibre, version 0.9.27
ERREUR : Erreur: Erreur pendant la communication avec le lecteur électronique (= Error communicating with device)

Failed to parse: 'XXX' with error: 'NoneType' object has no attribute 'remove'

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 260, in upload_books
ParseError: Failed to parse: 'XXX' with error: 'NoneType' object has no attribute 'remove'

I would like to attach the troublesome epub, but I do not know how to do it.
Thank you for your help.
Regards.

Kobo device removes ImageId on first restart

The first time the Kobo sees a new book, even with existing DB rows, it starts its usual processing and strips out series information and the image ID. If there's a way to stop the Kobo from processing new files, it needs to be implemented and tested to make sure it doesn't break anything.

This is not considered to be a major issue since plugging the device into calibre and allowing it to update the metadata will set the series data and image ID and the Kobo device won't remove it again.

Code contains copy of options from KoboTouch Driver

I am about to make two changes to the KoboTouch driver that mean changes to the options. Both changes will rename and slightly repurpose two options. No extra options will be added. At the moment.

Because this driver has copied the EXTRA_CUSTOMIZATION_MESSAGE and EXTRA_CUSTOMIZATION_DEFAULT structures and extended them, the options will get out of sync. I suggest changing the code to copy the values at runt time.

The following seems to work:

    EXTRA_CUSTOMIZATION_DEFAULT = KOBOTOUCH.EXTRA_CUSTOMIZATION_DEFAULT
    EXTRA_CUSTOMIZATION_MESSAGE = KOBOTOUCH.EXTRA_CUSTOMIZATION_MESSAGE
    EXTRA_CUSTOMIZATION_MESSAGE_SIZE = len(EXTRA_CUSTOMIZATION_MESSAGE)

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Enable Extended Features') + \
            ':::' + _('Choose whether to enable extra customisations'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(True)
    OPT_EXTRA_FEATURES = EXTRA_CUSTOMIZATION_MESSAGE_SIZE

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Delete Files not in Manifest') + \
            ':::' + _('Select this to silently delete files that are not in the manifest if they are encountered during processing. '
                'If this option is not selected, files not in the manifest will be silently added to the manifest and processed as if they always were in the manifest.'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(False)
    OPT_DELETE_UNMANIFESTED = EXTRA_CUSTOMIZATION_MESSAGE_SIZE + 1

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Upload DRM-encumbered ePub files') + \
            ':::' + _('Select this to upload ePub files encumbered by DRM. If this is not selected, it is a fatal error to upload an encumbered file'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(False)
    OPT_UPLOAD_ENCUMBERED   = EXTRA_CUSTOMIZATION_MESSAGE_SIZE + 2

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Silently Ignore Failed Conversions') + \
            ':::' + _('Select this to not upload any book that fails conversion to kepub. If this is not selected, the upload process '
                'will be stopped at the first book that fails. If this is selected, failed books will be silently removed from the upload queue.'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(False)
    OPT_SKIP_FAILED         = EXTRA_CUSTOMIZATION_MESSAGE_SIZE + 3

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Hyphenate Files') + \
            ':::' + _('Select this to add soft hyphens to uploaded ePub files. The language used will be the language defined for the book in calibre. '
                ' It is necessary to have a LibreOffice/OpenOffice hyphenation dictionary in ' + os.path.join(config_dir, 'plugins', 'KoboTouchExtended') + \
                ' named like hyph_{language}.dic, where {language} is the ISO 639 3-letter language code. For example, \'eng\' but not \'en_CA\'. The default dictionary to use '
                ' if none is found may be named \'hyph.dic\' instead.'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(False)
    OPT_HYPHENATE           = EXTRA_CUSTOMIZATION_MESSAGE_SIZE + 3

    EXTRA_CUSTOMIZATION_MESSAGE.append(_('Replace Content Language Code') + \
            ':::' + _('Select this to replace the defined language in each content file inside the ePub.'))
    EXTRA_CUSTOMIZATION_DEFAULT.append(False)
    OPT_REPLACE_LANG        = EXTRA_CUSTOMIZATION_MESSAGE_SIZE + 4

I haven't done a lot of testing. Just enough to prove it displays and changes the options correctly. Plus sent a couple of books with the "extended" option on and off.

I don't know if the above is the best way to do this. If there is a better way that needs a change in the KoboTouch driver, tell me and I'll look at it.

Calibre doesnt't detect Kobo Glo

Since I updated from Calibre 0.9.22 to 0.9.25 my Kobo Glo is nt detected.

I just downloaded and updated the KoboTouchExtended.zip plugin.
I created the KoboTouchExtended folder and added the hyphenation dictionary.
Kobo Desktop detects the Glo

The debug file reads as follows:
calibre Debug log
calibre 0.9.25 isfrozen: True is64bit: False
Windows-post2008Server-6.2.9200 Windows ('32bit', 'WindowsPE')
('Windows', 'post2008Server', '6.2.9200')
Python 2.7.3
Windows: ('post2008Server', '6.2.9200', '', 'Multiprocessor Free')
Qt: Untested Windows version 6.2 detected!
Starting up...
Loaded cached store plugin for: Amazon FR Kindle at version: 3
Loaded cached store plugin for: Barnes and Noble at version: 2
Loaded cached store plugin for: Amazon DE Kindle at version: 3
Loaded cached store plugin for: Amazon Kindle at version: 3
Loaded cached store plugin for: Project Gutenberg at version: 2
Loaded cached store plugin for: Amazon UK Kindle at version: 3
Loaded cached store plugin for: Amazon IT Kindle at version: 3
Loaded cached store plugin for: Amazon ES Kindle at version: 3
Started up in 16.33 seconds with 415 books

The Debug Device Detection reads as follows:
calibre 0.9.25 isfrozen: True is64bit: False
Windows-post2008Server-6.2.9200 Windows ('32bit', 'WindowsPE')
('Windows', 'post2008Server', '6.2.9200')
Python 2.7.3
Windows: ('post2008Server', '6.2.9200', '', 'Multiprocessor Free')
USB devices on system:
[u'usb\vid_045e&pid_0745&rev_0634&mi_01',
u'usb\root_hub20&vid8086&pid1e2d&rev0004',
u'usb\vid_2237&pid_4173&rev_0110',
u'usb\vid_12d1&pid_140c&rev_0000&mi_04',
u'usb\vid_045e&pid_0745&rev_0634&mi_02',
u'usb\vid_2232&pid_1028&rev_0003&mi_00',
u'usb\vid_8087&pid_0024&rev_0000',
u'usb\vid_12d1&pid_140c&rev_0000&mi_00',
u'usb\vid_12d1&pid_140c&rev_0000&mi_05',
u'usb\vid_2232&pid_1028&rev_0003',
u'usb\vid_0cf3&pid_3004&rev_0001',
u'usb\vid_12d1&pid_140c&rev_0000&mi_01',
u'usb\vid_8087&pid_0024&rev_0000',
u'usb\vid_12d1&pid_140c&rev_0000&mi_02',
u'usb\root_hub20&vid8086&pid1e26&rev0004',
u'usb\vid_12d1&pid_140c&rev_0000',
u'usb\vid_045e&pid_0745&rev_0634&mi_00',
u'usb\vid_045e&pid_0745&rev_0634',
u'usb\vid_12d1&pid_140c&rev_0000&mi_03']
Unable to get free space for drive: F
(21, 'GetDiskFreeSpaceEx', 'The device is not ready.')
Drives detected:
(0) G:\ ~ ?\STORAGE#VOLUME#_??USBSTOR#DISK&VEN_KOBO&PROD_EREADER-2.4.0&REV_0110#613A2A1023345&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}#{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B}
(1) H:\ ~ ?\STORAGE#VOLUME#
??_USBSTOR#DISK&VEN_KOBO&PROD_EREADER-2.4.0&REV_0110#613A2A1023345&1#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}#{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B}

Disabled plugins: KOBOTOUCHEXTENDED KOBOTOUCH

Looking for devices of type: MTP_DEVICE
List of WPD PNP ids:
[u'\?\wpdbusenumroot#umb#2&37c186b&0&storage#volume#_??usbstor#disk&ven_kobo&prod_ereader-2.4.0&rev_0110#613a2a1023345&0##{6ac27878-a6fa-4155-ba85-f98f491d4f33}',
u'\?\wpdbusenumroot#umb#2&37c186b&0&storage#volume#
??usbstor#disk&ven_huawei&prod_sd_storage&rev_2.31#8&78b8636&0##{6ac27878-a6fa-4155-ba85-f98f491d4f33}',
u'\?\wpdbusenumroot#umb#2&37c186b&0&storage#volume#
??_usbstor#disk&ven_kobo&prod_ereader-2.4.0&rev_0110#613a2a1023345&1##{6ac27878-a6fa-4155-ba85-f98f491d4f33}']
No suitable MTP devices found

Looking for devices...

Devices possibly connected: None

Unable to send 5 to 10% of books with 1.3.2

Plugin version 1.3.2
Calibre version : 0.9.31 64bit Windows
Kobo devices : Glo and Mini
Kobo Firmware : 2.5.2

I have sent successfully more than 2000 books to my Kobos with the previous version of the plugin.
Trying to send again these books with the 1.3.2 version, many of them crash.
For some (about 10%), an epub to epub conversion with calibre solve the problem.
But for the others there's a crash.
For the book you can find here : http://depositfiles.com/files/kmpqdeevk
The crash log is :

calibre, version 0.9.31
ERREUR : Erreur: Erreur pendant la communication avec le lecteur électronique

Failed to parse '[Bourbon Kid-1] Le Livre Sans Nom' by 'Anonyme' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 492)

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 557, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 259, in upload_books
InvalidEPub: Failed to parse '[Bourbon Kid-1] Le Livre Sans Nom' by 'Anonyme' with error: 'this element does not have children or attributes' (file: calibre_plugins.kobotouch_extended.container, line: 492)

The crash log is the same for many books, The only change sometimes is line 490 or 492 in container.

I'm French the book too. Hope my English is not too bad. If you need more informations, ask me.
Thanks for your good job.

Current hypenation option is not optimal

Current hypenation-related code, newly added, is probably overkill. I think so since the reader's software already has support for hyphenation and internal dictionaries for (all? most? I don't know) languages that are supported for the user interface. Adding soft-hyphens complicates the interface and makes the epub file slightly heavier.
I suppose that the current approach would still be valid for unsupported languages, however, I think that if a dictionary for the language is available on the device, there should be a way for the reader to know what dictionary to use, like on original kepubs. I was planning to do some research on this topic sooner or later, but I wanted to know your opinion on the subject: maybe you (@jgoguen) already made extensive research on this and concluded that the current way is the only one, then close this as a wontfix, no problem with that.

Additional Kobo span tags needed

From http://www.mobileread.com/forums/showpost.php?p=2482479&postcount=202

Sorry, I meant to say "further kobo id span tags (span id="kobo.1.1" and so on)." For instance, if a chapter is so long that it results in a certain screen page having no opening kobo span tag and you happen to close the book on this screen page, the book will not reopen at the correct screen page. As you might have noticed. in the preview kepubs from Kobo (and I therefore suppose also in the regular Kobo kepubs), they put a kobo span tag also in between sentences (with increasing second index number); in some books they additionally match each font attribute tag with a kobo span tag. Since the screen page breaks are depending on customizable values like font attributes, margins and so on, even those measures (namely, further kobo span tags) will not prevent kobo-span-tag-less screen pages in every possible case, or one will end finally putting kobo tags around each single letter.

The other problem I had was with ranges of text that were not at all covered by kobo span tags, as for instance tables and lists. This was of course my fault, since I did not think of those case at all to start with.

I do not know about your plug-in (and I do not know whether calibre changes tables and list to some other constructions), but judging from your description earlier in this thread your plug-in might be prone to these problems too.

version 1.3.1 of driver not sending known good books to device

  • Latest version of Calibre (0.9.30)
  • Latest version of plugin (1.3.1)
  • Kobo Glo fw 2.5.2
  • Error message:
    calibre, version 0.9.30
    ERROR: Error: Error communicating with device

Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 286, in upload_books
InvalidEPub: Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

  • Copy of the Calibre debug log:
calibre Debug log
calibre 0.9.30 [64bit]  isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.4
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Starting up...
Job: 1 Get device information started
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
Job: 2 Get list of books on device started
DEBUG:    0.0 KoboTouch:books - oncard='None'
DEBUG:    0.0 KoboTouch:books - oncard='None', prefix='G:\'
DEBUG:    0.0 Kobo device: Kobo Glo
DEBUG:    0.0 Version of driver: (1, 3, 1) Has kepubs: True
DEBUG:    0.0 Version of firmware: (2, 5, 2) Has kepubs: True
DEBUG:    0.1 [u'#myshelves', True, True, False, False, False, False, False, False, True, True, u'', True, False, False, False, False, False, False, False]
DEBUG:    0.1 KoboTouch:books - set_debugging_title to ''
DEBUG:    0.1 KoboTouch:books - length bl=0
DEBUG:    0.2 KoboTouch:books - length bl after sync=10
DEBUG:    0.2 KoboTouch:books - reading device database
DEBUG:    0.3 Database Version=78

#Removed shelf information 

Job: 1 Get device information finished
No details available.
DEBUG:    6.3 KoboTouch:books - automatically managing metadata
DEBUG:    6.3 KoboTouch:books - about to sync_booklists
DEBUG:    6.3 USBMS: starting sync_booklists
DEBUG:    6.4 USBMS: finished sync_booklists
DEBUG:    6.4 KoboTouch:books - have done sync_booklists
DEBUG:    6.4 KoboTouch:books - end - oncard='None'
DEBUG:    6.4 KoboTouch:books - oncard='carda'
DEBUG:    6.4 KoboTouch:books - oncard='carda', prefix='H:\'
DEBUG:    6.4 Kobo device: Kobo Glo
DEBUG:    6.4 Version of driver: (1, 3, 1) Has kepubs: True
DEBUG:    6.4 Version of firmware: (2, 5, 2) Has kepubs: True
DEBUG:    6.4 [u'#myshelves', True, True, False, False, False, False, False, False, True, True, u'', True, False, False, False, False, False, False, False]
DEBUG:    6.4 KoboTouch:books - set_debugging_title to ''
DEBUG:    6.4 KoboTouch:books - length bl=0
DEBUG:    8.9 KoboTouch:books - length bl after sync=307
DEBUG:    8.9 KoboTouch:books - reading device database
DEBUG:    8.9 Database Version=78

#Removed shelf information 

Started up in 36.98 seconds with 352 books
DEBUG:   12.7 KoboTouch:books - automatically managing metadata
DEBUG:   12.7 KoboTouch:books - about to sync_booklists
DEBUG:   12.7 USBMS: starting sync_booklists
DEBUG:   13.0 USBMS: finished sync_booklists
DEBUG:   13.1 KoboTouch:books - have done sync_booklists
DEBUG:   13.1 KoboTouch:books - end - oncard='carda'
DEBUG:   13.1 KoboTouch:books - oncard='cardb'
DEBUG:   13.1 KoboTouch:books - Asked to process 'cardb', but do not have one!
DeviceJob: 2 Get list of books on device done, calling callback
DeviceJob: 2 Get list of books on device callback returned
Job: 3 Send metadata to device started
DEBUG:   13.4 KoboTouchExtended:sync_booklists:Setting ImageId fields
Job: 2 Get list of books on device finished
No details available.
DEBUG:   40.5 KoboTouchExtended:sync_booklists:done setting ImageId fields
DEBUG:   40.5 KOBO: started sync_booklists
DEBUG:   40.5 KoboTouch:update_device_database_collections - oncard='main'
DEBUG:   40.5 KoboTouch:update_device_database_collections - set_debugging_title to ''
DEBUG:   40.5 KTCollectionsBookList:get_collections - start - collection_attributes= [u'#myshelves']
DEBUG:   40.5 KTCollectionsBookList:get_collections - collection_attributes= [u'#myshelves']
DEBUG:   40.5 KTCollectionsBookList:get_collections - end
DEBUG:   41.0 KoboTouch:update_device_database_collections - category='Finished' books=5
DEBUG:   41.1 KoboTouch:update_device_database_collections - end for category='Finished'
DEBUG:   41.1 KoboTouch:update_device_database_collections - managing bookshelves and series.
DEBUG:   41.1 KoboTouch:update_device_database_collections - about to clear empty bookshelves
DEBUG:   41.1 KoboTouch:delete_empty_bookshelves - start
DEBUG:   41.1 KoboTouch:delete_empty_bookshelves - end
DEBUG:   41.1 KoboTouch:update_device_database_collections - Number of series set=0 Number of books=5
DEBUG:   41.1 KoboTouch:update_device_database_collections - Finished 
DEBUG:   41.1 KoboTouch:update_device_database_collections - oncard='carda'
DEBUG:   41.2 KoboTouch:update_device_database_collections - set_debugging_title to ''

#removed shelf information 

DEBUG:   53.7 KoboTouch:update_device_database_collections - Number of series set=0 Number of books=307
DEBUG:   53.7 KoboTouch:update_device_database_collections - Finished 
DEBUG:   53.7 USBMS: starting sync_booklists
DEBUG:   54.1 USBMS: finished sync_booklists
DEBUG:   54.1 KOBO: finished sync_booklists
DeviceJob: 3 Send metadata to device done, calling callback
DeviceJob: 3 Send metadata to device callback returned
Job: 4 Upload 1 books to device:Plato and a Platypus Walk Into a Bar... started
Device using plugboard epub KOBOTOUCHEXTENDED [[u'{series:re(([^\\s])[^\\s]+(\\s|$),\\1)}{series_index:0>2s| - | - }{title}', u'title']]
Setting metadata in: Plato and a Platypus Walk Into a Bar... at: C:\Users\MB\AppData\Local\Temp\calibre_ue6w3g\remk_fcaltmpfmt.epub
DEBUG:   54.2 KoboTouchExtended:upload_books:Enabling extra ePub features for Kobo devices
DEBUG:   54.2 KoboTouchExtended:_modify_epub:Processing Plato and a Platypus Walk Into a Bar...
DEBUG:   54.2 KoboTouchExtended:_modify_epub:Failed conversions will raise exceptions
DeviceJob: 4 Upload 1 books to device:Plato and a Platypus Walk Into a Bar... done, calling callback
Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

Traceback (most recent call last):
  File "site-packages\calibre\gui2\device.py", line 85, in run
  File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
  File "calibre_plugins.kobotouch_extended.driver", line 286, in upload_books
InvalidEPub: Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

DeviceJob: 4 Upload 1 books to device:Plato and a Platypus Walk Into a Bar... callback returned
Job: 4 Upload 1 books to device:Plato and a Platypus Walk Into a Bar... finished
Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

    Traceback (most recent call last):
      File "site-packages\calibre\gui2\device.py", line 85, in run
      File "site-packages\calibre\gui2\device.py", line 551, in _upload_books
      File "calibre_plugins.kobotouch_extended.driver", line 286, in upload_books
    InvalidEPub: Failed to parse 'Plato and a Platypus Walk Into a Bar...' by 'Thomas Cathcart' with error: 'character mapping must return integer, None or unicode' (file: calibre_plugins.kobotouch_extended.container, line: 74)

Job: 3 Send metadata to device finished
No details available.

ZIP does not support timestamps before 1980

calibre, version 0.9.17
ERRORE: Errore: Errore di comunicazione col dispositivo

ZIP does not support timestamps before 1980

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 85, in run
File "site-packages/calibre/gui2/device.py", line 551, in _upload_books
File "calibre_plugins.kobotouch_extended.driver", line 183, in upload_books
File "calibre_plugins.kobotouch_extended.driver", line 173, in _modify_epub
File "calibre_plugins.kobotouch_extended.container", line 125, in write
File "zipfile.py", line 1045, in write
File "zipfile.py", line 295, in init
ValueError: ZIP does not support timestamps before 1980

I'm sending an affected file.
no-database branch.

Chapter display request

Hi jgoguen
I don't know if it is possible or easy to do to ensure that the Chapter number as well a page is shown at foot of page?
eg One book shows "Chap V - PG. 35 OF 38" and another " PG. 15 OF 33".
First example "" class="calibre1">Chapter V ""
Second example ""class="calibre1">""
Could this be an enhancement?
Thanks Michael
Will not let me display line of html

Files not in OPF manifest may cause parsing failures

Files detected during the Container initialization may not be in the OPF manifest, which means they won't have an associated MIME type. This causes the files to be returned as raw unicode objects, causing parsing failures.

Disappearing white space if the first html-codetag is preceded with a (white space)

Also posted this small but inconvenient bug on MobileRead (http://www.mobileread.com/forums/showpost.php?p=2482711&postcount=203)
There you'll find the original epub and kobofied kepub.

Short description here:
After kobofying an epub there is a bug if the first HTML-tag/code within the span class="koboSpan" is preceded with a white space. After kobofication this preceding white space is removed. White spaces preceding all following HTML-codes within the "koboSpan" class are honored.

Original epub test (extract)
`

Moody’s plaatst vraagtekens bij waardering*DE


Het bod van*JAB waardeert DEMB in totaal op 7,5 miljard euro.`

the * marks a white space that precedes the and

html-codetags.
These marked white spaces disappeare in the kobofied kepub.

Kobofied kepub conversion (extract):
`

Moody’s plaatst vraagtekens bij waarderingDE


Het bod vanJAB waardeert DEMB in totaal op 7,5 miljard euro.`

As said before this only happens when a white space precedes the first html-code/tag within the "koboSpan" class. No other spaces or characters are removed.

"This book can't be opened"

I have a couple of books that, when transferred with the extended driver, can only show the cover; when you try to change page a popup comes up saying "This book can't be opened" (approximated translation). If I move the file out from the device and then manually in (so that the database is purged from references to it) they work without problems.
I am also having another issue with chapters that seem to open in random order if I let the driver to add references to them in the database, while they are read in order if no changes to the database are made.
Is there any reason to add rows to the database relating to sigle chapters? I just see problems coming from this right now, but maybe it enables some feature I'm not aware of.

Possible way to use Kobo.js and Kobo.css

Citing from Project Gutenberg license, section 1.E:
1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg-tm License must appear prominently whenever any copy of a Project Gutenberg-tm work (any work on which the phrase "Project Gutenberg" appears, or with which the phrase "Project Gutenberg" is associated) is accessed, displayed, performed, viewed, copied or distributed:

This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org

1.E.2. If an individual Project Gutenberg-tm electronic work is derived from the public domain (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase "Project Gutenberg" associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or 1.E.9.

In every Kobo there's at least a kepub, called 6aca459b-396c-4a15-bced-77722c5d6012, that is derived from a Project Gutenberg work and maintains reference to the project; so this license apply. This Kepub contains the much needed js code and so this license should apply to it as well. I don't know if this license is compatible with the GPLv3 but I think this is worth to investigate.

Can't install KTEP

I can't install the Kobo ExtendedPlugin

Plugin error log
Calibre, version 0.9.27 / Windows 8 Pro

FOUT: Niet afgehandelde fout: SyntaxError:invalid syntax (calibre_plugins.kobotouch_extended.init, line 4)

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 310, in add_plugin
File "site-packages\calibre\customize\ui.py", line 361, in add_plugin
File "site-packages\calibre\customize\ui.py", line 53, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 169, in load
File "importlib__init__.py", line 37, in import_module
File "site-packages\calibre\customize\zipplugin.py", line 147, in load_module
File "calibre_plugins.kobotouch_extended.init", line 4

^
SyntaxError: invalid syntax

Full log
calibre Debuglog
calibre 0.9.27 [64bit] isfrozen: True is64bit: True
Windows-post2008Server-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', 'post2008Server', '6.2.9200')
Python 2.7.3
Windows: ('post2008Server', '6.2.9200', '', 'Multiprocessor Free')
Starting up...
Job: 1 Lees apparaatinformatie started
DeviceJob: 1 Lees apparaatinformatie done, calling callback
DeviceJob: 1 Lees apparaatinformatie callback returned
Job: 2 Lees boekenlijst van apparaat started
DEBUG: 0.0 KoboTouch:books - oncard='None'
DEBUG: 0.0 KoboTouch:books - prefix='None'
DEBUG: 0.0 Version of driver: (2, 0, 7) Has kepubs: True
DEBUG: 0.0 Version of firmware: 2.4.0 Has kepubs: True
DEBUG: 0.0 [u'', False, False, False, False, False, False, False, False, False, False, u'']
DEBUG: 0.0 KoboTouch:books - set_debugging_title to
DEBUG: 0.0 KoboTouch:books - length bl=0
DEBUG: 0.2 KoboTouch:books - length bl after sync=168
DEBUG: 0.2 KoboTouch:books - reading device database
DEBUG: 0.2 Database Version=71
DEBUG: 0.2 KoboTouch:books - shelf list: [u'Wishlist', u'Business / Management', u'Non-fictie', u'Thiller']
DEBUG: 0.2 KoboTouch:books - query= select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, ImageID, ReadStatus, ___ExpirationStatus, FavouritesIndex, Accessibility, IsDownloaded, Series, SeriesNumber, ___UserID from content where BookID is Null and ((Accessibility = -1 and IsDownloaded in ('true', 1)) or (Accessibility in (1,2)) ) and not ((___ExpirationStatus=3 or _ExpirationStatus is Null) )
DEBUG: 0.2 KoboTouch:books - looping on database - row=9
DEBUG: 0.2 KoboTouch:books - title='' authors= Kobo Inc.
DEBUG: 0.2 KoboTouch:books - row= (u'', u'Kobo Inc.', None, u'file:///usr/local/Kobo/help/10UserGuide-Legal.kepub.epub', u'application/x-kobo-epub+zip', u'6', None, 0, 0, -1, 1, 1, None, None, u'')
DEBUG: 0.2 KoboTouch:books - looping on database - row=10
DEBUG: 0.2 KoboTouch:books - title='' authors= Kobo Inc.
DEBUG: 0.2 KoboTouch:books - row= (u'', u'Kobo Inc.', None, u'file:///usr/local/Kobo/help/09UserGuide-Contacting_FNAC.kepub.epub', u'application/x-kobo-epub+zip', u'6', None, 0, 0, -1, 1, 1, None, None, u'')
DEBUG: 0.4 KoboTouch:imagefilename_from_imageID - no cover image found - ImageID=
DEBUG: 0.5 KoboTouch:imagefilename_from_imageID - no cover image found - ImageID=
Job: 1 Lees apparaatinformatie finished
Geen details beschikbaar.
DEBUG: 1.1 KoboTouch:books - about to sync_booklists
DEBUG: 1.1 USBMS: starting sync_booklists
DEBUG: 1.3 USBMS: finished sync_booklists
DEBUG: 1.3 KoboTouch:books - have done sync_booklists
DEBUG: 1.3 KoboTouch:books - end - oncard='None'
DEBUG: 1.3 KoboTouch:books - oncard='carda'
DEBUG: 1.3 KoboTouch:books - Asked to process 'carda', but do not have one!
DEBUG: 1.3 KoboTouch:books - oncard='cardb'
DEBUG: 1.3 KoboTouch:books - Asked to process 'cardb', but do not have one!
DeviceJob: 2 Lees boekenlijst van apparaat done, calling callback
DeviceJob: 2 Lees boekenlijst van apparaat callback returned
Job: 2 Lees boekenlijst van apparaat finished
Geen details beschikbaar.
Started up in 30.58 seconds with 4 books
Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 310, in add_plugin
File "site-packages\calibre\customize\ui.py", line 361, in add_plugin
File "site-packages\calibre\customize\ui.py", line 53, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 169, in load
File "importlib__init
.py", line 37, in import_module
File "site-packages\calibre\customize\zipplugin.py", line 147, in load_module
File "calibre_plugins.kobotouch_extended.init", line 4

^
SyntaxError: invalid syntax

Problem with pages and annotations

I just tried your calibre-kobo-driver and installing/configuring was no problem. Then I tried it with some books which I own as epub. First, there was no obvious problem but after going back to the home screen and re-opening the book, it started at a different page. Please note that this problem didn't occur with the original epubs nor with other "real" kepubs from Kobo. Also, the Kobo had problems with bookmarks I added to these transformed kepubs. It opened a different page - not that one were I added the bookmark.

I tried it with Calibre 0.9.19 and the latest calibre-kobo-driver (last commit from Mon Feb 18 22:24:43 2013). Kobo firmware is 2.3.1.

Can't install plug-in

Updated to Calibre 0.9.19 and downloaded files from here. When trying to install get this error:
calibre, version 0.9.19
ERROR: Unhandled exception: ImportError:cannot import name KOBOTOUCHEXTENDED

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 310, in add_plugin
File "site-packages\calibre\customize\ui.py", line 361, in add_plugin
File "site-packages\calibre\customize\ui.py", line 53, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 167, in load
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.kobotouch_extended.init", line 8, in
ImportError: cannot import name KOBOTOUCHEXTENDED

Batch processing improvement

Please it is possible to make Kobo-driver-extended to process each ebook in a batch separately? So if one of them is bad-coded will not prevent the other ebooks to be converted and copied in the reader.

Or another option could be to make the error message to display the name of the ebook that contains the error, so it's easier to find it.

Thank you

Problems in commenting

Hi Every time I comment it deletes so only way is to start new thread.
Hi
Seem to have problems in commenting tried 3 times.
Every time I press comment it goes blank! so only way to send was a new issue
Could not update via calibre and gained error message.
Followed your instructions and now have 2.0.5 installed.
Many thanks
Michael

Syntax error

I (hopefully) followed the instructions to the letter, but can't get the plugin to install!
SyntaxError:invalid syntax (calibre_plugins.kobotouch_extended.init, line 4)

I am using calibre, version 0.9.18

Optimize Kobo span generation

The Kobo span tags are added far more frequently than necessary. Use recently published KePub files to determine where spans can be skipped. Some quick targets:

  • Do not split on punctuation other than full-stop characters
  • It may not be necessary to descend into children of content nodes (b, i, em, etc.)

Removal of white spaces before html markup tags (#32)

Reopening bug #32 (removal of white spaces before html markup tags). The bug is still there. If only the option "enable extended features" is selected. Just only to Kobofy a book.

At least for "i", "em", "b", "strong", "small" tags, if these tags are preceded with a white space. This only applies to the first occurrence in a sentence.

"Hello world
"Helloworld ("world" is italicized, space removed before world)

You may check this also for "span class" tags.
Edit: "span" tags seems to be O.K.
Is it doable to temporary rename problem tags to span classes? And when the Kobfication has been done reverse it? Or add the new created span classes to the css?
E.g:
"i" becomes "span class="italic"
"b" becomes "span class="bold"
"small" becomes "span class="small-caps"
etc.

Hyphenation issue

Hi

I was testing the new hyphenation feature, I installed the italian hyphen dictionary as explained in the readme, then tried to upload several ebooks, but with hyphenation feature ON this is the resulting visualization on my Glo:
eruge6u6

This is the same ebook transferred on kobo with hyphenation feature OFF
tuba3uva

I tried on my Glo (Fw 2.5.0) and on my wife's Glo (Fw 2.4.0) and the result is the same.

Thank you

If there is an exclamation mark in the book file name, the book cannot be opened.

If the title of an a book has an exclamation mark in it, then the default save template mean the file name will also have an exclamation mark. The device will process the book and add it to the library, but when you try to open it, there is a "cannot open" error. This was reported in http://www.mobileread.com/forums/showthread.php?p=2467473.

The exclamation mark doesn't cause a problem in the file name for epubs.

Checking through calibre, there is callback "sanitize_path_components". Adding the following code to driver.py solves this:

def sanitize_path_components(self, components):
    return [x.replace('!', '_') for x in components]

I haven't tested to see if there are other characters that cause problems.

Image IDs are unconditionally added

It's possible to tell Calibre not to send images to the device. If images are not to be sent, the ImageId field should not be set and sync_booklists should not attempt to update image IDs.

calibre 64bit Version: 0.9.19 problem.

When I upgraded to latest calibre 64bit
Version: 0.9.19 IT removed plugin and when I tried to load it got this error:
calibre, version 0.9.19
ERROR: Unhandled exception: ImportError:cannot import name KOBOTOUCHEXTENDED
Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 310, in add_plugin
File "site-packages\calibre\customize\ui.py", line 361, in add_plugin
File "site-packages\calibre\customize\ui.py", line 53, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 167, in load
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.kobotouch_extended.init", line 8, in
ImportError: cannot import name KOBOTOUCHEXTENDED
Went back to .18 no problems.
Any comment?
Thanks Michael

Implement calibre-style byte string decoding

Kovid has pointed me at the calibre.ebooks.oeb.base.decode() method as an example of how to best decode files the same way calibre does. This method needs to be copied and made to work inside the existing Container class to ensure that files are handled as close to the same way as calibre for best results.

Could not open books with Kobo 2.5.1

Hi there,

I did update my Kobo Glo to 2.5.1 a few days ago. I am using your extenden Kobo driver (1.2.7) with Calibre 0.9.28. If I send a book to the reader, everything works fine on Calibre-side. The *.kepub file is placed on the readers storage. But if I try to open the book on Kobo Glo I am getting an error ("Oops! This document couldn't be opened - There might be a problem with the file..."). Do you know a fix for this issue?

Best regards,
SlimShady0208

Issue with HTML tags - fail to copy book to device

Calibre version: 0.9.31-x64 (Windows)
Plugin version: 1.3.2
Device: Kobo Aura HD (firmware 2.5.2)

Tag combinations such as <p><b><br /></b></p> cause the driver to emit an error.
I've created a new EPUB with Sigil and pasted this particular tag combination to isolate the issue, this book is available to be sent if you so desire.

Please note that other combinations similar to this one also cause errors, if I encounter them again I'll be sure to mention them. They do seem to have in common that there's no text within the innermost tags and/or the different style of tag notation: <tag> ... </tag> vs. <tag />.

Metadata update fails if too many books in Kobo

Calibre : 0.9.31
Plugin : 1.3.3
Kobo : 2.5.2

I have more than 4000 books on my Kobo.
I sent them 500 by 500.
Since about 3000, the update of metadata step, after books transfer, fails :

calibre, version 0.9.31
ERREUR : Erreur: Erreur pendant la communication avec le lecteur électronique

too many SQL variables

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 506, in _sync_booklists
File "calibre_plugins.kobotouch_extended.driver", line 347, in sync_booklists
File "calibre_plugins.kobotouch_extended.driver", line 342, in _rows_needing_imageid
OperationalError: too many SQL variables

Error communicating with device / transfer

This would be on calibre 0.9.20, device is a Kobo Glo, on connection or transfer:

ERROR: Error: Error communicating with device
no such table: content
Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 85, in run
File "site-packages/calibre/gui2/device.py", line 500, in _sync_booklists
File "calibre_plugins.kobotouch_extended.driver", line 248, in sync_booklists
OperationalError: no such table: content

No problems with the vanilla plugin.

After calibre 0.9.19 fix, kobo.x.x ids are not added

Hi, after the changes caused by the update to calibre 0.9.19, it seems that html files are not parsed anymore. Neither class="koboSpan" nor id="kobo.x.x" get added, while the property to the cover image in the opf file is correctly added.

JS file

One thing I have wondered.... Have you considered having people download a "free" Kobo eBook, and then having the plugin extract the js file from it, and add it into the books you convert?

That way you are not distributing the file, you are merely providing a tool that permits the user to extract the file and add it to their books?

book loop back at the end of chapter

Hello jgoguen,

first of all let me say great job! I opened this issue cause I am having some problem in the majority of the books (not all but with only one at the moment I do not have problem) I upload with your extended module. In practice I am always stuck at the cover page once I open a book. I can read the book by using the toc jumping on a specific chapter, but when I reach its end i loop back to the cover page and again the only way to get rid of it is to use pass through the table of content.

Another thing I wanted to say is related to the problem of the bookmarks. With the last firmware upgrade many people have exerienced the problem of the bookmarks. A possible solution is to set the margin size to zero. Indeed all the original kepub I have taken from my kobo has the margin size set to zero.

Another comment is on the kobo tags which are added. I have noticed that your plugin as well as the suggestions of dsandrei in his blog adds only the hash tag kobo.x.y, while I have noticed that in the original kepub the string is more complex and appear in the form of: . I have no idea if the class="KoboSpan" has any effect on the file.

Thanks for your work and let me know if I can help you somehow!

Maurizio.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.