Hi Varlog,
Yes, I think we can get the script manager into main branch just fine if we make the following additions:
1. When scripts are registered the user must select a type from the following list:
1. Input Script
2. Output Script
3. Editor Script
4. Metadata Script
That is stored in Sigil SettingsStore.
This "type" will determine the interface and arguments to be passed to the script
2. Add the modal Dialog with infinite progress bar and cancel button. Upon completion it will show success or failure and if failure a error widget with text gathered from the QProcess standard error pipe.
3. In order to pass results and information back to Sigil we have only the exit status, and, stdout and stderr pipes/channels from the QProcess to work with. Therefore we will serialize the required output into an xml stream to pass back in the stdout channel.
4. Inside Sigil we can read this file after the script finishes and parse it easily using a simple xml parser to get the results, files modified, etc. We can write wrapper scripts in python and other languages to illustrate how output stream is done. The user would simply copy this wrapper, and use it to call their script. The exact language of the serialized xml result file will of course vary by script type.
My main weakness is Qt widgets and ui, whereas I understand forking processes and working with and serializing process pipes/channels quite well. So I propose we divide and conquer.
If you could focus on items 1 and 2 above (extending the script registration to include it script type, and creating a modal dialog with infinite progress indicator, a cancel button and a popup text window to show error results), I can focus on items 3 and 4 and writing a python wrapper script with functionality similar to what calibre plugins can do.
How does that sound?
Take care,
KevinH
Quote:
Originally Posted by varlog
I've uploaded DGSM-0.0.3, which is basically just DGSM-0.0.2 rebased on your latest work (there were conflicts). There are some other small changes. The source is raw, I haven't cleaned it lately  .
It is a very nice development  . It is too early to include it in main Sigil tree of course  . Perhaps a branch, if you'll find it worthy?
Then again, judging from this thread's traffic, the Sigil community here (DD being an exception) is not very much interested in this functionality?
Anyway, my itch is as strong as ever and I'll be scratching it. Any help/comments are really really welcomed.
a) I have done almost nothing with tabs.
b) only selected resources are saved at the moment
d) I do this, I think 
e) depending on sigilAction I reload selected or all
Thank you for your time.
|