In your __init__ method, you're calling this method:
- Code: Select all
rest.app.run(ssl_context='adhoc')
which is never returning. So the plugin is basically non-functional because that method has taken over execution. It can't load the various XML files, etc. The plugin base class sets up the plugin execution environment - which is called into from the indigo server to perform functionality so you can't tie up the main thread with an unending process. Comment out that line and Configure... shows and brings up the dialog. You also get the debugging statements that you have in the plugin.py file in the event log - before you didn't.
You'll need to start that process in a different thread - probably from the startup method and shut it down from the shutdown method, though there are various alternatives for threading (see runConcurrentThread for a simple threading mechanism). I don't really know what the purpose of the plugin is so I can't really steer you any further. This is also why you always see this error when you try to reload your plugin:
- Code: Select all
Error process (pid 71736) failed to quit after polite request -- forcing it to quit now
You can open the plugin's prefs file directly if needed - it's located here:
/Library/Application Support/Perceptive Automation/Indigo 6/Preferences/Plugins/YOURPLUGINID.indiPref
It's a simple XML file - the top level element is <Prefs> and each of the fields in your config is the element name (<apitoken111>). However, I suspect you don't need to read it yourself - you'll want to get the prefs in the plugin.py file using the standard methods and then pass them to the new thread you're setting up to do whatever it is that's happening in the above method call. Up to you of course.
Oh - you need to change your plugin's id (com.perceptiveautomation.indigoplugin.glasshouse) to your own unique namespace - com.perceptiveautomation.* is reserved for us. If you have a registered domain name, just use that (reversed of course), if not just make up something that's not likely to be used by someone else. Duplicate plugin ids will cause no end of trouble.
BTW, I'm going to move this thread over to the "Extending Indigo with Plugins and Python" forum since it's specifically an issue with building a plugin.