Deadline version

I need to collect the deadline version in a script I am writing, but am having issue with the return I need. I can get the version via the cmd line using the following:

C:\Program Files\Thinkbox\Deadline\bin>deadlinecommand -version
which yields this result:

Deadline Version 5.2.0.49424

c 2002-2012 Thinkbox Software Inc

but can I get just the version line as a variable in a python file. I know its doable, but having a brain episode.

Cheers

Here’s some pseudo:

result = “deadlinecommand.exe -version”

if result command returns:
result = “Deadline Version 5.2.0.49424 c 2002-2012 Thinkbox Software Inc”

verStr = result.split()
returns:
“[‘Deadline’, ‘Version’, ‘5.2.0.49424’, ‘c’, ‘2002-2012’, ‘Thinkbox’, ‘Software’, ‘Inc’]”

version = verStr[2]
returns:
‘5.2.0.49424’

Deadline v7.0 introduces 2 x new ./DeadlineCommand args:

“-GetMajorVersion” returns “7”
“-GetVersion” returns “v7.0.0.44 R (178863210)”

Awesome, thanks very much Mike. :sunglasses:

Hi Mike or whoever sees this. I have written a .py file that I need to use to get the version, but the code errors when executed and I am unsure why.
Script contents:

from Deadline.Scripting import *
from System.IO import *
import os, sys

def main(*args):

theVersion =  "deadlinecommand.exe -version"
if theVersion:
    verStr = theVersion.split()
    version = verStr[2]
f = open('C:\\repoInfo.txt', 'w')
f.write( str(version) + '\n')
f.flush()
f.close()

At the moment, I am writing it to a text file to check, but the version info will be used in a python script. It will not be called via the command line, that is not what the end result needs to be.

thanks

#UPDATED: Think I need to use ProcessUtils.

What is the whole result here? Maybe if you give us a full overview we can think of more clever ways to do what needs to be done.

Its ok, I managed to get what I want and no need for any clever solutions. All I wanted to do was get the deadline version as a variable in my script so that I could check it against the multiple versions we have installed as while we are migrating to version 6, there are some artists still using version 5, but all artists need to access the script I am updating. I know that the Windows registry can only hold one version so I was looking to exploit what is held therein.

It was relatively easy once I had gone through various pages of the documentation and used the following to get what I need. Mikes way was not producing what I wanted and seemed to be pointed at using the command line, though I may have misunderstood the pseudo code he put. If anyone else needs it, here is what I did, which writes the variable to a text file. I did this just as a check, I will use a variable that holds the version in my script.

from Deadline.Scripting import *
from System.IO import *
import os, sys

def main(*args):
f = open(‘C:\versionInfo.txt’, ‘w’)
f.write(str(ClientUtils.GetBinDirectory()) + ‘\n’)
f.write(str(GetExecutableVersion( ‘deadlinecommand.exe’ )) + ‘\n’)
f.flush()
f.close()

I find using the Deadline documentation is frustrating as there are errors contained that make using it a real pain.

Actually, a very clean approach, which will only work on Windows is like this, without any external file scrubbing:

[code]from System.Diagnostics import *
from System.IO import *

from Deadline.Scripting import *

def main():
DeadlineCommandExe = Path.Combine( ClientUtils.GetBinDirectory(), “deadlinecommand.exe” )
DeadlineCommandExeInfo = FileVersionInfo.GetVersionInfo( DeadlineCommandExe )
version = DeadlineCommandExeInfo.FileVersion[/code]

Please list the issues, so we can fix them. The new documentation is already available in the v7.0 private beta program.

Thanks for the reply regarding the version info, it is a really nice, concise way to get the version info and will be very useful. I will try it in my script later today.

If I had time to list the issues with the documentation Mike, I would, but this issue has been raised before by me and acknowledged by staff at Thinkbox, specifically when the Deadline 6 webinar was online and questions were put to the guys then, so I do not have a list of the things I have found, or not found.
I realise that putting documentation together demands a lot of time and input and we are grateful for it, I just wish it was a little more in depth in places. There are lists of processes, but no real application examples, or if there are, they are inside default scripts, but not listed or mentioned in the description. Finding an example requires going through the scripts that come with deadline, but I do not have the time to do that in the hope of getting a script that has the process contained therein.

There are pages for Deadline 6 that go to Deadline 5 pages and vice versa, so it becomes confusing when you start reading about a process, realise its the same as Deadline 5 or 6, then you have to research again and then look for the right page and so on. There is sometimes a lack of consistency in the traversal of the pages.

I also acknowledge that I may be at fault and perhaps it is a lack of initial experience with Deadline that has caused some of my issues, so I am not placing responsibility for not finding what I want solely at Thinkbox`s door.

I am sure you guys are on the case as the software goes from strength to strength, so look forward to the new developments and updates to all areas of Deadline

Thanks

Can I just check you are aware that beyond the website hosted Deadline user manual, which is also available as an offline pdf/chm file, there is also the dedicated Scripting API reference manual (pdf/chm) and the Standalone Python API reference manual:
thinkboxsoftware.com/deadlin … mentation/

The scripting API reference manual explains the different available overloads in the generic .NET “process” object. To understand the Process class, I would recommend reading up via the .NET / msdn site: msdn.microsoft.com/en-us/library … o(v=vs.110.aspx

When Deadline v7.0 is launched, the current v5/v6 docs will be cleaned up and presented via our new docs site, based on client feedback via various sources including the webinars. Feel free to preview and provide feedback on these changes and more via the v7.0 private beta.

Our best code examples in many cases our the actual working application plugin/scripts throughout Deadline. I would suggest time spend getting up to speed with their different approaches, is time very well spent, to understand the true capabilities of Deadline and it’s API extensibility.

Thanks for the feedback.