View Single Post
Old 02-11-2012, 02:34 PM   #25
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,629
Karma: 5433388
Join Date: Nov 2009
Device: many
release version of mergeKF8Only_v050.py

Hi Peter and DiapDealer,

I cleaned up the code, removed redundant pieces, formed proper classes, added debug information, etc.

So here is the release version of mergeKF8Only_v050.zip

mergeKF8Only 0.50
based on mobi_unpack.py code written by: Charles M. Hannum,
P. Durrant, K. Hendricks, S. Siebert, fandrieu, DiapDealer, nickredding.

Description:
In a dual KF8 mobi file, replaces the original mobi portion
with a KF8Only message, leaving the KF8 portion untouched.

Usage:
mergeKF8Only_v050.py -h -d infile.mobi message outfile.mobi

Options:
-h print this help message
-d use verbose debugging

The message file must be:
- a mobi html file in raw markup language format
- less than 4096 bytes in total
- utf-8 encoded

One easy way to generate a message file is to use kindlegen to create a mobi which consists just of your message and then unpack that mobi with WRITE_RAW_DATA set to be true using mobi_unpack.py. A sample test.rawml file is included in the zip archive. It can be edited with any good text editor.

Have fun!

KevinH
Attached Files
File Type: zip mergeKF8Only_v050.zip (5.9 KB, 335 views)
KevinH is offline   Reply With Quote