|
|
#16 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,074
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
|
|
|
|
|
|
|
#17 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,074
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
I did a quick test on one chapter, and my idea of inserting an extra sub-item to point to the start of the chapter or section does work on my PRS-505. It will take me a couple of days to figure out how to do it in python, but a script to automate it should be available sometime soon. Even if O'Reilly come up with something better, this could be useful for unencrypted epubs from other sources. So, bluerfoot, hang onto that 650.
|
|
|
|
|
|
#18 | |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
|
Quote:
|
|
|
|
|
|
|
#19 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
|
Insult to injury, I did not get a case due to possibly returning it, and I just put a massive scratch across both the silver paint and the screen.
|
|
|
|
|
|
#20 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,074
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
python sonyfy.py Erlang_Programming.epub and it produces a file called Erlang_Programming__PRS.epub with a new TOC. Hmm, the attachment software doesn't accept .py files, so I renamed it to sonyfy.txt. Just change it back to .py after you download it. |
|
|
|
|
|
|
#21 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
|
For sure be trying this today, thanks for helping me make lemonade ...
|
|
|
|
|
|
#22 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
|
It works perfectly, boy on a separate note I really need to learn python, I started learning perl but perhaps that is not the way to go...one last question...would it be possible to
a) make it open the table of contents expanded? as it is now it opens up just book title and you then have to open the book. kind of silly since you are already reading that book its like duh...why should I have to click it again? Anyway great thanks... |
|
|
|
|
|
#23 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,074
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Quote:
![]() As for your request, how about I tell you how to go about it, and you use it as an exercise in learning python? The extra button push doesn't bother me enough to make me want to put in the extra effort . The place to add your code is in the method 'sonyfyTOC', just before the loop that starts inserting additional items. You want to check if the first 'navPoint' element has any other 'navPoint' siblings, and if it doesn't, you want to move all of its 'navPoint' children (and the '#text' nodes around them) up to be its siblings. To move each one in turn, use 'removeChild()' based on its current navPoint parent, and then 'insertChild()' based on the navMap parent. That probably sounds confusing, but if you unzip the original epub file and look at the 'OEBPS/toc.ncx' file, you'll see how the XML structure is laid out and it'll make more sense. The indenting will be wrong in the new TOC file, but that won't affect how it works in the e-reader. Go to http://docs.python.org/library/xml.dom.html and look at the 'Node Objects' section to see how to manipulate the XML elements. I expect this would take about ten to twenty lines of code. (It's funny that the net result of all this will be to move one '</ncx:navPoint>' line in the file )
|
|
|
|
|
|
|
#24 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
|
Thanks, I will look at it. Btw when I say a little perl I mean I have never programmed before and I am at chapter 5 in oreilly's intro (learning perl) book. So this will be quite a challenge to me
![]() I do plan on fully reviewing your script and documenting it as a start. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| When should we start seeing 350/650 in stores | Avwriter | Sony Reader | 526 | 10-01-2011 05:26 PM |
| Do Kobo books need tweaking before loading to a PRS-350 or PRS-650? | stodge | Sony Reader | 9 | 11-07-2010 03:30 PM |
| Graphic on Chapter start no showing | theducks | Astak EZReader | 0 | 05-05-2010 11:33 AM |
| PRS-600 Horizontal line at start of chapter | Gernella | Sony Reader | 0 | 01-03-2010 11:28 AM |
| Digital Books Start A New Chapter | Gatton | News | 0 | 02-22-2006 08:32 AM |