Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2011, 01:01 PM   #91
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,183
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by siebert View Post
Sorry, but using strings with delimiters would be a very unpythonic solution.
I agree with this. I hate the idea of concatenating arbitrary strings with some fixed delimiter.

I would have thought that making them all lists was actually quite a simple and clean solution, even if most of them end up as a list of just one item. Surely python handles single item lists fairly efficiently?
pdurrant is offline   Reply With Quote
Old 07-22-2011, 01:02 PM   #92
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,183
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by siebert View Post
I'm almost done (the temporary file code was also removed), do you want me to just publish it when its finished, or do you want to take a look before (let me know your email address then)?
I think you might as well just post it here once you're done.
pdurrant is offline   Reply With Quote
Old 07-22-2011, 01:12 PM   #93
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
I'm thinking about redirecting the "Info:", "Warning:" and "Error:" output lines to stderr instead of stdout. Any thoughts on that?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-22-2011, 03:13 PM   #94
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,183
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by siebert View Post
I'm thinking about redirecting the "Info:", "Warning:" and "Error:" output lines to stderr instead of stdout. Any thoughts on that?

Ciao,
Steffen
I don't suppose it would do any harm, so if it would make your use of it easier, I don't see why not.

[EDIT: I see KevinH does have a good reason for not redirecting these.]

Last edited by pdurrant; 07-22-2011 at 03:25 PM. Reason: Reading KevinH's post below
pdurrant is offline   Reply With Quote
Old 07-22-2011, 03:21 PM   #95
KevinH
Guru
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: 833
Karma: 349410
Join Date: Nov 2009
Device: many
Hi,

Quote:
Originally Posted by siebert View Post
I'm thinking about redirecting the "Info:", "Warning:" and "Error:" output lines to stderr instead of stdout. Any thoughts on that?

Ciao,
Steffen
Please leave these as stdout. If you look, stdout has been modified to run completely unbuffered (to flush after every write).

This is done to support a front-end gui program that invokes this python script via a python subprocess library so that any progress or errors/ warnings are shown in the gui log window in real time.

For people with Python properly installed, they can double-click on the MobiUnpack.pyw program and use simple gui elements to run the program. This is much easier for some people.

Please see MobiUnpack.pyw from the google-code site I pointed you at earlier or I can post it for you if you like.

Thanks,

Kevin
KevinH is online now   Reply With Quote
Old 07-22-2011, 04:22 PM   #96
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
Quote:
Originally Posted by KevinH View Post
Hi,
Please leave these as stdout. If you look, stdout has been modified to run completely unbuffered (to flush after every write).
Shouldn't it be possible to make stderr unbuffered, too?

By separating stdout and stderr the gui could ignore the stdout messages completely (or use them to show a progress bar instead) and only messages on stderr would be displayed in the log window, as they indicate something unusual the user should be aware of.

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-22-2011, 04:40 PM   #97
KevinH
Guru
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: 833
Karma: 349410
Join Date: Nov 2009
Device: many
Hi,

On many systems stderr is always automatically unbuffered io. This is true for Mac OS X and Linux but I am not sure about Windows.

But you typically read them from separate pipes and can get "out of order" conditions that can be confusing to the user (ie. should you read and print the stderrr or stdout first when both pipes have data waiting). There might be a way to pipe them both to the same output when invoking the script via subprocess but that is typically OS dependent..

It is simply easier to keep everything going to stdout so that progress and any error messages can be seen in the log window which makes it nice/easy for bug reports from users who use the gui program that exists for them.

Thanks,

Kevin

ps. Here is the full tool set with the gui in case you want to modify or change it. It is very simplistic and meant to be basically independent of the underlying python script it invokes to the extent possible.

If python is in your path, you should be able to unzip and then double-click on MobiUnpack.pyw or MobiM22HTML.pyw and run the scripts (stored in the lib)
Attached Files
File Type: zip MobiTool.zip (24.3 KB, 99 views)

Last edited by KevinH; 07-22-2011 at 04:48 PM.
KevinH is online now   Reply With Quote
Old 07-23-2011, 10:25 AM   #98
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
mobiunpack 0.29

Hi,

here is mobiunpack.py version 0.29 with the following changes:
  • NEW: Handle multiple metadata entries of the same type.
  • NEW: Additional metadata tags added.
  • CHANGED: Special handling of huge files is no longer required.
  • CHANGED: Reenable skipping of known non-image sections.
  • FIXED: Convert non-ascii filenames to utf-8 in opf.
  • FIXED: StartOffset shouldn't create a visible index entry.

mobiunpack_0.29.zip

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-23-2011, 10:58 AM   #99
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,183
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by siebert View Post
Hi,

here is mobiunpack.py version 0.29 with the following changes:
  • NEW: Handle multiple metadata entries of the same type.
  • NEW: Additional metadata tags added.
  • CHANGED: Special handling of huge files is no longer required.
  • CHANGED: Reenable skipping of known non-image sections.
  • FIXED: Convert non-ascii filenames to utf-8 in opf.
  • FIXED: StartOffset shouldn't create a visible index entry.

Attachment 74742

Ciao,
Steffen
Thanks. It looks good. I didn't notice any special handling of the author tag, but I'll do some tests with the latest KindleGen. Perhaps it works properly with multiple author tags now.
pdurrant is offline   Reply With Quote
Old 07-23-2011, 11:04 AM   #100
KevinH
Guru
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: 833
Karma: 349410
Join Date: Nov 2009
Device: many
Hi Steffen,

I didn't notice metadata 404 anyplace in the code which I think is the Text To Speech (TTS) flag. We might want to add that so that people can see whether this is enabled or not.

Thanks for your great work on this.

Kevin
KevinH is online now   Reply With Quote
Old 07-23-2011, 11:07 AM   #101
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
Quote:
Originally Posted by pdurrant View Post
Thanks. It looks good. I didn't notice any special handling of the author tag, but I'll do some tests with the latest KindleGen. Perhaps it works properly with multiple author tags now.
mobigen/kindlegen accept multiple entries for some tags and ignores all but the first entry for other tags. The output of mobigen/kindlegen shows what metadata will be used for the generated book.

And multiple authors worked for me.

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-25-2011, 02:38 PM   #102
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,183
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by siebert View Post
here is mobiunpack.py version 0.29 with the following changes
Now copied back to my post on the first page of the thread: http://www.mobileread.com/forums/sho...36&postcount=5
pdurrant is offline   Reply With Quote
Old 07-26-2011, 04:19 AM   #103
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 38
Karma: 12
Join Date: Jul 2009
Device: ppc
I tried every version one by one, and get happier then. 0.29 is better in many ways.
For the better, I report just bad result here.
words reflection works, but javascript function does not, pop error after mobi back using mobigen.
most images work, but some warnings about invalid images come out when using the 0.29 rendered and untouched opf by mobigen.
naisren is offline   Reply With Quote
Old 07-26-2011, 04:38 AM   #104
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
Quote:
Originally Posted by naisren View Post
words reflection works, but javascript function does not, pop error after mobi back using mobigen.
AFAIK only the Mobipocket Reader supports javascript, while the Kindle Devices and Apps don't, so I have no use for the javascript features in Mobipocket.

If someone finds out what needs to be changed I might fix it.

Quote:
most images work, but some warnings about invalid images come out when using the 0.29 rendered and untouched opf by mobigen.
Warnings about invalid content or insufficient sizes? And is the exported image broken if you open it with an image viewer? Can you provide me the original mobi file for testing?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-26-2011, 04:39 AM   #105
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 136
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 3 WiFi / Nexus 4 (Android)
Quote:
Originally Posted by pdurrant View Post
Now copied back to my post on the first page of the thread: http://www.mobileread.com/forums/sho...36&postcount=5
Great. Did you have success with the multiple authors test?

Ciao,
Steffen
siebert is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 08:00 PM.


MobileRead.com is a privately owned, operated and funded community.