How to check if the code is being executed by a server process?
|
|
---|---|
Hi, I would like to check with PyTango if the code is being executed by a Tango DS: I was trying this:
But it exits the process:
Any hint would be appreciated. Thanks! Zibi |
|
|
---|---|
Hi Zibi I guess you are asking for a non-fatal way to check? Your example is not in a TangoDS, so we expect an error. It turns out the tango.Util.instance() method takes an optional (and undocumented) parameter in PyTango, and that parameter is whether or not to exit on error. cppTango code here. Set it to false, if you don't want to exit.
Regards, Anton |
|
|
---|---|
Many thanks Anton! This was what I was looking for. Just in case it makes sense to (re)add it to the docs, I opened this PR: https://github.com/tango-controls/pytango/pull/408. Let's discuss it there. |