Reload modules?

Posted on
Wed Nov 07, 2018 12:59 am
gabbas offline
Posts: 31
Joined: Jun 22, 2008

Reload modules?

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?

Posted on
Wed Nov 07, 2018 9:48 am
matt (support) offline
Site Admin
User avatar
Posts: 19129
Joined: Jan 27, 2003
Location: Texas

Re: Reload modules?

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.

Image

Posted on
Wed Nov 07, 2018 9:55 am
jay (support) offline
Site Admin
User avatar
Posts: 15467
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Reload modules?

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.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Dec 28, 2018 8:33 pm
gabbas offline
Posts: 31
Joined: Jun 22, 2008

Re: Reload modules?

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)

Posted on
Sun May 12, 2019 4:03 pm
matt (support) offline
Site Admin
User avatar
Posts: 19129
Joined: Jan 27, 2003
Location: Texas

Re: Reload modules?

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.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests