Hi varlog,
Okay, I spent some time reworking the python script support end for Sigil. I have modified the launcher.py to work for all 3 main types of scripts (input, edit, and output) and have modified the wrapper.py file to allow editing and changing of non-manifests files (i.e. all ebook files). I have also written containers for output and input to use the wrapper.
Included are numerous bug fixes and things.
To test with this, simply unpack the attached zip and cd into launcher. Then unzip an epub previously saved from Sigl into the ebook directory.
The launcher now takes slightly different parameters:
1.) path to ebook root
2.) path to output directory
3.) type of script (edit, input, output)
4.) path to target script to import and invoke run
So for example when I unpack all of these onto my Desktop I would use the following command line"
python ./launcher.py ~/Desktop/ebook/ ~/Desktop/testout/ edit ~/Desktop/target_script/test_target.py
The Smarten and NewUUID versions I posted earlier should all still function with this new version.
The python end of things is getting close to completion. It still needs a lot more testing and a way to pass in a single resource to the launcher which in turn needs to pass that along to the target script in some fashion. Other than that, this version should be functionally complete.
I have attached the latest version.
As for the Sigil side of things, I have spent some time looking at that too. It seems we will need to set the dialog modal but still use show() so that the event loop keeps working underneath it all. We also have to do our own wait loop, that allows gui events to be processed while waiting for the QProcess to complete (and not call waitforfinished()). Let me know when you have something rough working from the Sigil end and I will try building it and can then help out more. Lets focus on just launching the script and passing the parameters in first. We can then work together on parsing the wrapper xml and properly updating the Sigil internals.
Hope this helps,
Take care,
KevinH
Last edited by KevinH; 08-12-2014 at 03:50 PM.
|