def get_git_version():
 if DEVELOP:
  match = '--match=*.*.*build*'
 else:
  match = '--match=*.*.*'
 try:
  version = subprocess.check_output(('git describe --abbrev=4 --tags'.split() + [match])).strip()
 except:
  version = 'unknown'
 fout = open('RELEASE-VERSION', 'wb')
 fout.write(version)
 fout.write('\n')
 fout.close()
 fout = open('GIT-COMMIT', 'wb')
 try:
  commit = subprocess.check_output('git rev-parse HEAD'.split()).strip()
 except:
  commit = 'unknown'
 fout.write(commit)
 fout.write('\n')
 fout.close()
 return version

def get_git_version ( ) : if DEVELOP : match = '--match=*.*.*build*' else : match = '--match=*.*.*' try : version = subprocess . check_output ( ( 'git describe --abbrev=4 --tags' . split ( ) + [ match ] ) ) . strip ( ) except : version = 'unknown' fout = open ( 'RELEASE-VERSION' , 'wb' ) fout . write ( version ) fout . write ( '\n' ) fout . close ( ) fout = open ( 'GIT-COMMIT' , 'wb' ) try : commit = subprocess . check_output ( 'git rev-parse HEAD' . split ( ) ) . strip ( ) except : commit = 'unknown' fout . write ( commit ) fout . write ( '\n' ) fout . close ( ) return version
get the version from git .