[SOLVED]python exit does not exit

Posted on
Fri Jan 10, 2014 10:43 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: python exit does not exit

self.pluginPrefs.available(...,...)

or with
try:
self.pluginPrefs.get(.,.)

except:
loop

Posted on
Sat Jan 11, 2014 1:12 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: python exit does not exit

Or:

Code: Select all
if YOURKEY in self.pluginPrefs:
    # do your thing here


Lots of options.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jan 11, 2014 1:18 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: python exit does not exit

"just" figured it out , .. steeling from other plugins

Posted on
Sat Jan 11, 2014 5:35 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: python exit does not exit

on my way to learn: how do I get for a variable the folderId from folderName

i can get if a folderName or FolderID exists, but not convert one to the other


thanks

Karl

Posted on
Sat Jan 11, 2014 7:33 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: python exit does not exit

From the UI you can right-click on any object (device, schedule, trigger, folder, variable) to copy its ID to the clipboard. From a script you could get the ID via:

Code: Select all
indigo.variables.folders.getId(someFolderNameStr)


Also note that just about any Indigo python API that takes and ID will also work with the string name for that object. Using IDs is recommended though because then scripts will be more robust if the UI name ends up changing for any reason.

Image

Posted on
Sat Jan 11, 2014 9:55 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: python exit does not exit

I have been looking for these things and it looks to that the information is spread in different places.

is there an automated way like applescript dictionary I can look these things up?

Posted on
Sun Jan 12, 2014 11:00 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: python exit does not exit

That particular method didn't make it into the folder documentation - I just added it. When looking for information on IOM objects (devices, triggers, etc.), the first place to look that should be complete (assuming we haven't missed something like getId) is in the IOM Reference Documentation.

When you have questions about building a plugin, start with the Plugin Developer's Guide.

The server plugin tutorial has some information in a more concise format, but it's duplicate of what should be available in other places. It's also very much a draft at this point. I think we've found that it's a bit less necessary since by the time most developers have the more specific questions they can usually find it in one of the example plugins in the SDK.

So, anyone doing serious development should read through the Developer's Guide and Reference, then skim the tutorials. Finally, the examples in the SDK provide well documented code that shows how to do much of what you're looking for. And of course there's nothing wrong with asking questions. In this case, it was good for everyone since we'd somehow missed documenting that method call.

Finally, AppleScript's documentation is basically equivalent to the Reference Guide - but because our API provides so much more functionality (that AppleScript couldn't) the documentation is necessarily more complex.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 2 guests