View Single Post
Old 12-16-2014, 10:39 AM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,810
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi,
It actually did but was quickly replaced with the error message when the plugin-ended.

So if you were to run a longer plugin you would see that print output. That way the plugin can update the user using simple print statements while running longer tasks.

If you use your own try/catch block and handle the error, you would see the print output. But as soon as the plugin completes it will show either stdout on success or stderror on failure and not some asynchronous mix.

Hope this explains how things are meant to work.

KevinH

Quote:
Originally Posted by turbulent View Post
Hi, Kevin

I'm using Sigil 0.8.2 on Win7. I create a test plugin as below:
Code:
def run(bk):
    print 'This line should be displayed.'
    print variable_not_exist
    return 0
Running this plugin, the message is:
Code:
Status: failed

Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\\python\launcher.py", line 135, in launch
    self.exitcode = target_script.run(container)
  File "C:\Users\xj\AppData\Local\sigil-ebook\sigil\plugins\test\plugin.py", line 7, in run
    print variable_not_exist
NameError: global name 'variable_not_exist' is not defined
Error: global name 'variable_not_exist' is not defined
"variable_not_exist" is undefined to trigger the error. I expect the message "This line should be displayed." to show up. But it didn't.
KevinH is offline   Reply With Quote