Hi varlog,
Quote:
1. I differentiate between menu bar script and context menu script and am somehow fond of it. Context script operates "only" on selected items. Either tell me why not or edit_launcher should be able to take selected items as arguments.
|
Should not be an issue, we can simply pass along information via command line to modified edit_launcher.py and it can add info to bookcontainer.py passed to target script
Quote:
2. I have assumed that all script input data will be referenced to/copied from Sigil temporary work folder. When you know Sigil(!) epub root directory, you know the path to opf (./OEBPS/content.opf). Do we need to pass the path to it nevertheless?
|
And yes we could build opf_path if we know Sigil will always name the opf as content.opf and not target.opf or allow the base name to be language specific.
The wrapper knows the output dir and ebook root, but it is hidden from bookcontainer.py which is the object passed to target scripts run() method.
All file access is done thru bookcontainer.py through the wrapper and it copies nothing until you actually want to write out a modified version. Reading from the true Sigil ebook files is also wrappered but allowed. The actual files inside Sigil are never modified and only the modified or added ones ever get written to the output directory
Quote:
3. Doing tests with test_target I got Manifest ID error: I think it's because Sigil doesn't write mimetype file in its tmp book folder - which I used for test at first. I think we don't really want to make epub from Sigil temporary files and then unpack it somewhere else?
|
The manifest id error came from where? If you can capture the console log to a file and zip it and post it, I can try to figure out what is happening. If it is the test_target.py code, then the provided content.opf file manifest is incomplete or messed up (or a bug exists in my launcher code that parses the opf to create the initial state of the wrapper! The actual mimetype file is never looked for or used, just the mime media-type from the manifest section of the opf.
Or, alternatively, perhaps my post was unclear ... the instructions I sent were to test with from a Linux/MacOSX terminal bash prompt command line, not to interface into Sigil yet. So to *simulate* what a Sigil ebook directory might be like, I asked you to save an epub from Sigil and then unpack it. So please just test from command line (not part of Sigil yet) to get a feeling for how the process would work.
Quote:
Just to clarify:
"input" means Sigil will be reading in epub produced by script,
"output" means script will transform data from Sigil and write it somewhere outside Sigils jurisdiction.
"edit" means script will change Sigil data and Sigil will have to accommodate it.
"meta" is actually "edit" but only for metadata.
|
Yes. All correct, and you are right we don't need the meta type script as the edit type can do the job.
Hope this explains things a bit more.
KevinH