summaryrefslogtreecommitdiffstats
blob: 94f851032975e5fdb74f4f7aec9d7a05fc3cd311 (plain)
1
2
3
4
5
6
7
8
9
10
import subprocess, os

def getGitBuildVersion() :
  p = subprocess.Popen("git rev-parse HEAD", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=(os.name != "nt"))
  return p.stdout.read().rstrip()[0:7]

def getBuildVersion(version = None) :
  if version :
    return version
  return getGitBuildVersion()