Page 1 of 1

Reload modules?

PostPosted: Wed Nov 07, 2018 12:59 am
by gabbas
Does "Reload Libraries and Attachments" no longer reload modules that were imported from embedded scripts? When I have some non-trivial Indigo Python to write (but it's not a plugin) I usually put it in a module that's symlinked into /Library/Python/2.7/site-packages, and call it from an embedded script so my embedded script is short. Like, one of my trigger actions will often just be something like "import mymodule / mymodule.myfunction()". That way I can use my own preferred text editor, version-control my code in git, and so on. This used to work fine because invoking the "Plugins -> Reload Libraries and Attachments" menu item used to reload all such modules, apparently by restarting the Python process on the server. But Indigo 7.2 doesn't appear to reload my module any more... the only workaround I've found now is to completely shut down the Indigo server and start it up again. Restarting the server takes a lot longer and feels more disruptive; is there a better way?

Re: Reload modules?

PostPosted: Wed Nov 07, 2018 9:48 am
by matt (support)
It looks like something changed/broke that caused that functionality to drop out. We'll make sure it is working again in 7.2.1.

Re: Reload modules?

PostPosted: Wed Nov 07, 2018 9:55 am
by jay (support)
In the meantime, you can find the IndigoPluginHost process in Activity Monitorthat is the ScriptExecutor.indigoPlugin process (do a get info on the IPH process, switch to Open Files and Ports tab and the first line should contain that) and kill it. That will cause embedded scripts to have access to changes. Not sure it's that much faster than restarting the Server, but it's an option and isn't as disruptive.

Re: Reload modules?

PostPosted: Fri Dec 28, 2018 8:33 pm
by gabbas
Thanks guys, that helps! What I ended up doing was writing a trigger that I can invoke manually, that executes
Code: Select all
import os
import signal
os.kill(os.getpid(), signal.SIGKILL)

Re: Reload modules?

PostPosted: Sun May 12, 2019 4:03 pm
by matt (support)
Indigo 7.3 (and 7.3.1) are now available and will now stop and reload the python script executor when the Plugins->Reload Libraries and Attachments menu is selected.