View unanswered posts | View active topics It is currently Sun May 19, 2013 8:22 pm



Reply to topic  [ 4 posts ] 
 Moving Plugin to Plugins (Disabled) on Syntax Error 
Author Message
User avatar

Joined: Sep 07, 2010
Posts: 231
Location: Toronto, Canada
Post Moving Plugin to Plugins (Disabled) on Syntax Error
I forget exactly when this behavior changed, but it used to be the case that if I tried to startup a plugin that had a syntax error, the plugin would immediately be moved to Plugins (Disabled). This is no longer the case with Indigo 5.0.4, and possibly 5.0.3?

It seems that if the syntax error is serious enough to immediately cause the plugin to fail, the plugin is not moved. Because I open the files with BBEdit from the (Disabled) folder, I can't quickly fix the error and save the file unless I go into the finder and manually move the folder first.

Not a huge deal, more of a nuisance than anything. And I don't recall this ever happening in earlier versions of Indigo 5.

Thanks!


Sat Mar 31, 2012 2:30 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11683
Location: Texas
Post Re: Moving Plugin to Plugins (Disabled) on Syntax Error
Hi Travis,

I don't recall it ever moving failed plugins (for any reason) to the Disabled folder. Now some plugins might disable themselves (which moves them to that folder), but I don't think Indigo has ever done that itself.

I'm not quite following the workflow/nuisance problem with editing the file. Can you explain in more detail? Note one thing I do is keep all of my plugins in a different folder (svn repo), then I put aliases of the plugins into the Enabled/Disabled folder. Indigo will just move the alias around, which might or might not help the workflow problem you are experiencing.

_________________
Image


Sat Mar 31, 2012 3:23 pm
Profile WWW
User avatar

Joined: Sep 07, 2010
Posts: 231
Location: Toronto, Canada
Post Re: Moving Plugin to Plugins (Disabled) on Syntax Error
Hi Matt,

You're right, I didn't explain it properly. You already solved my problem with the alias idea but I'll better explain myself so you can understand the change in behavior I've noticed.

My usual workflow is:
1. Disable Plugin
2. Open plugin's files for editing from the "Plugins (Disabled)" folder.
3. Edit Code
4. Save changes to code
5. Enable Plugin to test code changes - Indigo moves Plugin folder to "Plugins"
6. Disable Plugin - Indigo moves Plugin folder back to "Plugins (Disabled)".
7. Repeat steps 3 thru 6 as I work on the plugin

The problem is if the plugin fails to initialize, like this for example ...
Plugin "DSC Alarm" connected
DSC Alarm Error Error in plugin execution InitializeMain:

Traceback (most recent call last):
File "plugin.py", line 12, in <module>
<type 'exceptions.SyntaxError'>: ('invalid syntax', ('/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/DSC Alarm.indigoPlugin/Contents/Server Plugin/DSC.py', 8, 6, 'class\n'))

Error plugin "DSC Alarm 1.0.6" failed to initialize
Disabling plugin "DSC Alarm 1.0.6"
Stopping plugin "DSC Alarm 1.0.6" (pid 91479)
Plugin "DSC Alarm" disconnected


Indigo disconnects the plugin. I can't execute step 6 to disable the plugin because it seems to have already been disabled. If I pull down the plugin's menu it only says Enable. My plugin's folder is still located in the Plugins folder, it is never moved to Plugins (Disabled). So when I edit my code to resolve the error and then try to save it, BBEdit throws an error saying it can't find the file on the server, because of course it's still in the Plugins folder.

Unless I'm losing it, this behavior has changed recently. I used to able to select Disable no matter what the error was.

Using your idea with aliases is a more elegant solution.

Thanks


Sat Mar 31, 2012 4:01 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11683
Location: Texas
Post Re: Moving Plugin to Plugins (Disabled) on Syntax Error
I think what happened was I added some code that doesn't officially mark the plugin as enabled (internal state) until after it has successfully launched. If it doesn't launch correctly, then it isn't yet enabled (in this case "enabled" also includes up-and-running).

I don't believe it ever automatically Disabled failed plugins, but it probably did used to let you choose the Disable menu item (step 6 of yours) which would then move it out to the Disabled folder where BBEdit can find it.

_________________
Image


Sat Mar 31, 2012 5:09 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.