Identifying Indigo Major Version

Posted on
Tue Apr 11, 2017 6:22 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Identifying Indigo Major Version

The following works just fine (and theoretically should be future proof):
Code: Select all
indigo.server.version.split('.')[0]

I was just curious if there was a convenience method for identifying the major version.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Apr 11, 2017 6:42 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Identifying Indigo Major Version

There is an internal plugin API which we we haven't publicized yet that you can use:

Code: Select all
if self.serverVersCompatWith("7.0.4"):
    # do something that only is allowed on 7.0.4.

It compares the passed in string, which can be of format X, X.Y, or X.Y.Z to the current server version and returns True if the server version is at least that high.

Image

Posted on
Tue Apr 11, 2017 7:13 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Identifying Indigo Major Version

Thanks Matt - my use case is much more pedantic. I occasionally write things directly to the Indigo log folder and want to know what path to shoot for.

Your method above will be very useful elsewhere though. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Apr 11, 2017 7:54 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Identifying Indigo Major Version

Ah, gotcha. Your split technique should be fine – I don't expect that would ever not work correctly.

Image

Posted on
Tue Apr 11, 2017 8:06 am
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Identifying Indigo Major Version

I thought there was an API call to get the base Indigo directory?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Apr 11, 2017 8:24 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Identifying Indigo Major Version

Ah, yes there is: indigo.server.getLogsFolderPath()

Image

Posted on
Tue Apr 11, 2017 3:50 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Identifying Indigo Major Version

matt (support) wrote:
Ah, yes there is: indigo.server.getLogsFolderPath()

I like that better. It's easier to tell what the code does (when I come back to look at it later, having forgot).

Thanks all.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests