Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 11-18-2010, 11:59 AM   #16
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,054
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
Quote:
Originally Posted by bluerfoot View Post
I did speak with oreilly and they will look at the issue, I actually have a bit of faith that if it is something they can fix that they will. I see I have a 21 say return policy with dell so I will hang on a bit longer.

once you try touch clicking is a crutch...
I was going to try hacking an epub by hand today to see if I could make it work (by adding the additional TOC entries). If it does work, it wouldn't take long to write a python script to do it automatically. I'll report on my results later in the day.
rkomar is offline   Reply With Quote
Old 11-18-2010, 02:30 PM   #17
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,054
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
Quote:
Originally Posted by rkomar View Post
I was going to try hacking an epub by hand today to see if I could make it work (by adding the additional TOC entries). If it does work, it wouldn't take long to write a python script to do it automatically. I'll report on my results later in the day.
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.
rkomar is offline   Reply With Quote
Old 11-18-2010, 05:16 PM   #18
bluerfoot
Zealot
bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'
 
Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
Quote:
Originally Posted by rkomar View Post
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.
That is nice news. I have an oreilly python book perhaps if the toc worked I would be writing the script. Seriously thanks I really want the portability and touch of the prs-350
bluerfoot is offline   Reply With Quote
Old 11-19-2010, 01:13 PM   #19
bluerfoot
Zealot
bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'
 
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.
bluerfoot is offline   Reply With Quote
Old 11-20-2010, 02:04 AM   #20
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,054
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
Quote:
Originally Posted by bluerfoot View Post
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.
Oh well, I guess it's a keeper, then. On the plus side, I got that script for 'Sony'fying the TOC of epubs done. I've really only tested it on O'Reilly epubs, but it worked on all 14 of mine. I've also only tested it on my Linux system, perhaps it needs some tweaking for use on a Windows machine. Anyways, I run it like this:

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.
Attached Files
File Type: txt sonyfy.txt (3.7 KB, 225 views)
rkomar is offline   Reply With Quote
Old 11-20-2010, 07:28 AM   #21
bluerfoot
Zealot
bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'
 
Posts: 115
Karma: 42554
Join Date: Nov 2010
Device: sony pocketbook 350
For sure be trying this today, thanks for helping me make lemonade ...
bluerfoot is offline   Reply With Quote
Old 11-20-2010, 08:07 AM   #22
bluerfoot
Zealot
bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'
 
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...
bluerfoot is offline   Reply With Quote
Old 11-20-2010, 12:25 PM   #23
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 3,054
Karma: 18821071
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
Quote:
Originally Posted by bluerfoot View Post
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...
I used to use perl for some heavy-duty text processing, and it's very good for that kind of work. Python, however, seems cleaner as a language, and I find it much easier to understand the code I wrote when I look at it again six months down the road.

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 )
rkomar is offline   Reply With Quote
Old 11-20-2010, 01:25 PM   #24
bluerfoot
Zealot
bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'bluerfoot understands when you whisper 'The dog barks at midnight.'
 
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.
bluerfoot is offline   Reply With Quote
Reply


Forum Jump

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 04:26 PM
Do Kobo books need tweaking before loading to a PRS-350 or PRS-650? stodge Sony Reader 9 11-07-2010 02:30 PM
Graphic on Chapter start no showing theducks Astak EZReader 0 05-05-2010 10:33 AM
PRS-600 Horizontal line at start of chapter Gernella Sony Reader 0 01-03-2010 10:28 AM
Digital Books Start A New Chapter Gatton News 0 02-22-2006 07:32 AM


All times are GMT -4. The time now is 05:10 AM.


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