View Single Post
Old 05-23-2014, 09:41 AM   #731
tkeo
Connoisseur
tkeo began at the beginning.
 
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
KindleUnpack v0.66ex, the preview version for epub3 suport

Hi All,

I have modified KindleUnpack to support epub3.

This is not completed it yet. I am not satisfied with the method to switch the output epub version; so, I am considering to change it to bit flags or something in order to increase flexiblity for future extentions.

Bug reports and suggestions are welcomed.

Major modifications are as follows,
  • Added mobi_cover.py, mobi_nav.py and mobi_taglist.py.
  • A parameter epubver(default=2) is added to process_all_mobi_headers(), unpackBook() and writeOPF().
  • In mobi_opf.py, build functions of package parts are extracted from writeOPF().

Detailed changes are in the following:
Spoiler:

KindleUnpack v0.66ex preview for primary epub3 support.
Change log.

Added mobi_cover.py, mobi_nav.py and mobi_taglist.py.

In kindleunpack.py,
A parameter epubver(default=2) is added to process_all_mobi_headers() and unpackBook().
'--epub3' is added to the command line options.
Modified process_all_mobi_headers() to support epub3: creating an epub3 opf and a navigation document.
Modified not to rename the cover image filename but to write out as coverXXXXX.ext.
Modified to find a cover page in k8proc instead of files.

In mobi_cover.py,
The CoverProcessor class is moved from mobi_resc.py.
DiapDealer's svg wrapper version is merged.

In mobi_nav.py,
The NAVProcessor class is created to support the navigation document of epub3.

In mobi_opf.py,
Build functions of package parts are extracted from writeOPF().
A parameter epubver(default=2) is added to writeOPF().
A parameter navname(default=None) is added to __init__().
Added functions for epub3.
Modified to remove same tags which are generated by kindleunpack previously.

In mobi_resc.py,
Modified the K8RESCProcessor class for clarity:
The Spine class is added and moved functions from the K8RESCProcessor;
a spine object is added as a member of the K8RESCProcessor.
Functions create() and getItemidList() in which routines are pulled out from
kindleunpack.py and mobi_opf.py respectively, are added to the Spine.
The function metadata_toxml() is modified to output comments
in order to remove same tags which are generated by kindleunpack previously.
The CoverProcessor class is moved to mobi_cover.py.
The minidom version of the K8RESCProcessor class is removed.
Attached Files
File Type: zip kindleunpack_v66ex.zip (63.8 KB, 204 views)
File Type: txt change_log.txt (1.6 KB, 214 views)
File Type: txt KindleUnpack_v66_to_v66ex.patch.txt (75.4 KB, 223 views)
tkeo is offline   Reply With Quote