View Single Post
Old 01-01-2012, 09:17 PM   #28
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: 2,986
Karma: 18343081
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 Snuffi View Post
Maybe one could define a folder for zip/unzip operations. I put a zip-file into that folder, run the unzip app and it unzips everything in that folder. After that I can edit with PI and save to same folder. Last step would be to run the zip app which would zip everything in that folder.

Basically all one would need is a shell script calling zip/unzip with the parameter of that folder. What's still kinda clumsy is putting the zip file into that folder and taking it out afterwards...
The problem with shell scripts executed from the Application tab is that you don't get to see any text that is outputted, nor do you get to input anything. Basically, you need to run the script from a shell to interact with it properly.

At least that was the problem until yesterday . I've been thinking that it would be good to write a simple Inkview application that could be used within a script to display messages and get input from the user. So, I did that, and the first script I wrote with it was one for editing EPUB files. Doing file selection is clunky because Inkview doesn't have such a dialog element, so I used the table of contents dialog in its place. I'm thinking that the one available inside Pi is better than mine, but I'll leave the script as is. Anyone who wants to can edit the script by hand and change it to do whatever they like.

The script can be got from: http://www3.telus.net/rkomar/edit-epub/. Some binary files are required (zip, unzip, sh_ivtools, and Pi); the addresses where they can be downloaded from are available in the README.txt file for the webpage.

If you add "edit-epub.app" to the list of EPUB applications in /mnt/ext1/system/config/extensions.cfg, then you can automatically run it from the Library application via the "Open" menu; no command-line required at all!

I would recommend having an off-device backup of any EPUB that is to be edited. The program worked fine for me during testing, but I'm sure that bugs lurk in there somewhere.
rkomar is offline   Reply With Quote