![]() |
#1021 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Okay I modified things to not change the stdout.encoding on python 2 unless it was set to None (which can happen when you pipe or redirect to a file). I also ran everything through reindent.py that will fix all indentations to be exactly 4 chars, remove all tabs, and strip all whitespace from the end of each line. This way your IDE should not be seeing so many things changed when you post your next patch. I have attached the updated and hopefully closer to final version of nlib.zip here. I will remove all older broken versions. Thanks, KevinH Last edited by KevinH; 10-09-2014 at 11:38 AM. Reason: remove outdated attachment |
![]() |
![]() |
![]() |
#1022 | |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
Quote:
Since in my IDE (spyder), parameters are not able to passed by kernel32 call. Could you keep it in until the end of this debug? Thanks, |
|
![]() |
![]() |
Advert | |
|
![]() |
#1023 |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
These are errors of the latest nlb code. 1. test1.azw3 with python 3 (fixed): Spoiler:
2. test1.azw3 with python 3: Spoiler:
3. test5.azw3 with python3: Spoiler:
python 2: Spoiler:
4. test2.azw3 with python 3(fixed): Spoiler:
I have modied to intent to fix case 1 and 4. Followings is the patch. Spoiler:
Take care, |
![]() |
![]() |
![]() |
#1024 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Please note everything but file names and paths in mobi_k8proc.py must be bytes (bytestring), so as not to force the upconverting to unicode anyplace in that routine. So only filenames and path segments should have utf8_str on it and all literals should start with a b. Since the type field was mixed sometimes 'inline' vs b'inline' or 'file vs b'file', this is what caused the None in the directory (it did not properly detect we had inlined the CDATA) In mobi_cover.py, everything is converted to unicode asap then only the cover page xhtml should be encoded to utf-8 just before file creation. I will check to make sure that this follows. Thanks for testing. I will get a new version out after incorporating some of your changes but trying to keep to the rules I stated above. Thanks, KevinH ps. I have attached a new version of nlib.zip below. If this is no more stable than its predecessor, I am going to split out all binary routines into their own modules and convert to unicode at the boundary instead of trying to keep the code mostly the same as before. It is just too hard to know what the data types are for each variable and so it gets confusing as to what should be converted to binary strings and what kept as unicode. Right now most parts of mobi_header, mobi_index, mobi_dict, parts of mobi_ncx, parts of mobi_k8resc, mobi_k8proc, and most parts of mobi_html require some form of binary bytes code. Then kindleunpack has to deal with both types and convert properly when mixing them. If I have to I will completely refactor the code to move all binary bytes processing to dedicated modules to try to prevent mixed data types in the same module completely. I probably should have done that from the beginning but never dreamed it would be this hard to track down and fix all of the inconsistencies. Thanks again for all of your hard work testing it and sending patches. KevinH Last edited by KevinH; 10-09-2014 at 11:49 AM. Reason: Added new version of nlib.zip |
![]() |
![]() |
![]() |
#1025 |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
The latest version of nls.zip unpack all my test ebooks without any errors!! I will check unpacked data more carefully this weekend. Thanks, |
![]() |
![]() |
Advert | |
|
![]() |
#1026 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Great news! Hopefully, it will not mess anything up in the detailed tests. Refactoring the code may not then be needed, but in the long run I think it is a good idea. Thanks, KevinH |
![]() |
![]() |
![]() |
#1027 |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
I find bugs. 1. All Style directories are empty and regarding css in content.opf are absent, when unpacking with python 3. 2. File names in mobi7 directories are wrong. book.html, content.opf and toc.ncx are in mobi7. Take care, Last edited by tkeo; 10-10-2014 at 09:03 AM. Reason: Added 2. |
![]() |
![]() |
![]() |
#1028 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,587
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
With the old way of using the original file name for the various mobi7 files, it was possible for KindleUnpack to create invalid opf/ncx files (namely when ampersands were in the original file name). Is there something that's been inadvertently overlooked/broken by using a similar naming convention as the KF8 routines? |
|
![]() |
![]() |
![]() |
#1029 | |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi,
Quote:
I have compared with v0.75. By v0.75 the filenames in mobi7 have the original filenames with extentions(html, opf and ncx). Thanks, Last edited by tkeo; 10-10-2014 at 09:41 AM. Reason: fixed typo. |
|
![]() |
![]() |
![]() |
#1030 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,587
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Ah, sorry... I had access to a pre-0.76 beta (before the python3-compatibility overhaul) where Kevin had made that change at my request/suggestion (and his agreement). I'd forgotten that no one had really seen that change yet. Do you foresee any issues with it?
Last edited by DiapDealer; 10-10-2014 at 10:21 AM. |
![]() |
![]() |
![]() |
#1031 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Quote:
Point 2 is expected behaviour as the file name was causing issues in opf with spaces and illegal characters. So I changed mobi7 to act similar to how mobi8 acts. Point 1 is totally my fault. I changed the 'inline' and 'file' strings to be binary everplace but missed 1 place! In processMobi8 in kindleunpack.py, I should have changed things to test for b'file' instead of 'file'. I will make than change, clean-up a number of non-parallelisms, and minor nits then we should be good to go. Thanks again for all of your help and testing!!!!! - edit - I have put together what I hope is the first stable version: nlib_rev1.zip of what will eventually become the heart of KindleUnpack_v0.80. If there are users of KindleUnpack that know how to use the command-line, please try unpacking your mobis and report any bugs with this version here. I will move on to porting the gui frontend next. Much of the tk stuff has changed module names, so this should be fun! Take care, KevinH Last edited by KevinH; 10-10-2014 at 03:07 PM. Reason: added a new version hopefully the first stable version |
|
![]() |
![]() |
![]() |
#1032 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi tkeo,
I would like to merge your experimental support for unpacking audio and video into this new upcoming 0.80 version since that would make a very nice new feature to go along with the boring port changes. I know you added patches for this. Do you want me to convert them to dual python 2 / python 3 use or do you want to do it? Thanks, KevinH |
![]() |
![]() |
![]() |
#1033 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi All,
Since I need a github tree to work on Sigil, I was thinking of adding in KindleUnpack as an additional project. So does anyone know if there is quick way to initialize a github tree with copies of lots of release versions. Or do I literally have to start with the very first and commit it and then go version by version committing all 60 or so of them one at a time? Thanks, KevinH |
![]() |
![]() |
![]() |
#1034 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,788
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Looking for Older Official Release Versions
Hi All,
I would like to build a github repository with as full a history as possible for all of the official (non-testing, on-experimental) releases of KindleUnpack I have scoured this Thread as well as all of my available sources and I have found the following official versions. If anyone has any other release versions they are willing to share I would love to have a complete set. Thanks! Kevin mobiunpack_v011.py mobiunpack_v012.py mobiunpack_v014.py mobiunpack_v015.py mobiunpack_v016.py mobiunpack_v017.py mobiunpack_v018.py mobiunpack_v019.py mobiunpack_v020.py mobiunpack_v021.py mobiunpack_v022.py mobiunpack_v023.py mobiunpack_v024.py mobiunpack_v026.py mobiunpack_v027.py mobiunpack_v028.py mobiunpack_v029.py mobiunpack_v030.py mobiunpack_v031.py mobiunpack_v032.py Mobi_Unpack_v034.zip Mobi_Unpack_v035.zip Mobi_Unpack_v036.zip Mobi_Unpack_v042.zip Mobi_Unpack_v045.zip Mobi_Unpack_v047.zip Mobi_Unpack_v050.zip Mobi_Unpack_v053.zip Mobi_Unpack_v054.zip Mobi_Unpack_v056.zip Mobi_Unpack_v058.zip Mobi_Unpack_v060.zip KindleUnpack_v062.zip KindleUnpack_v063.zip KindleUnpack_v063a.zip KindleUnpack_v064.zip KindleUnpack_v065.zip KindleUnpack_v066.zip KindleUnpack_v067.zip KindleUnpack_v070_experimental.zip KindleUnpack_v071.zip KindleUnpack_v072a.zip KindleUnpack_v072b.zip KindleUnpack_v073.zip KindleUnpack_v075.zip KindleUnpack_v076pre_release.zip nlib_rev1.zip Last edited by KevinH; 10-11-2014 at 09:33 AM. Reason: updated list of found versions |
![]() |
![]() |
![]() |
#1035 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,989
Karma: 315160596
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
I seem to have 0.12 (attached)
And possibly 0.14 and 0.15 Last edited by pdurrant; 10-11-2014 at 04:03 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 04:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 07:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 01:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 12:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 09:28 AM |