Re: [Nuke-python] error messages in init.py

2014-03-12 Thread Mathias Möhl
Wow, thanks a lot for the detailed help, Nathan and Jesse! Cheers, Mathias On 12 Mar 2014, at 17:46, Jesse Kretschmer wrote: > For getting information to the user, I use the python logging module. I > install my own handler for nuke. After it's set, I just call > myLogger.warning() (or debug

Re: [Nuke-python] error messages in init.py

2014-03-12 Thread Jesse Kretschmer
For getting information to the user, I use the python logging module. I install my own handler for nuke. After it's set, I just call myLogger.warning() (or debug, info, error, critical). Regarding exceptions in the init and menu, it's imperative to have stable code to keep nuke launching. A try/a

Re: [Nuke-python] error messages in init.py

2014-03-12 Thread Nathan Rusch
Wednesday, March 12, 2014 12:47 AM To: nuke-python@support.thefoundry.co.uk Subject: Re: [Nuke-python] error messages in init.py Thank you for the help, Diogo. But what to in in the except? In a terminal session I probably want to print() the error message, but in a GUI session I rath

Re: [Nuke-python] error messages in init.py

2014-03-12 Thread Mathias Möhl
Thank you for the help, Diogo. But what to in in the except? In a terminal session I probably want to print() the error message, but in a GUI session I rather want to nuke.message() it. Is there any way to distinguish between the two? Cheers, Mathias On 12 Mar 2014, at 00:00, Diogo Girondi wr

Re: [Nuke-python] error messages in init.py

2014-03-11 Thread Diogo Girondi
Using "Try/except" I guess, using "raise" directly will do just that. Cheers, Diogo On Tue, Mar 11, 2014 at 10:18 AM, Mathias Möhl wrote: > Hi, > what’s the correct way to raise any errors in init.py and ensure that they > are shown to the user when he is running nuke with UI? > If I put thi