def _create_version():
 import os
 from subprocess import check_output, CalledProcessError, STDOUT
 version = 'Unknown'
 root = os.path.dirname(os.path.abspath(__file__))
 try:
  with open(os.path.join(root, 'VERSION.txt'), 'r') as f:
   version = f.read().strip()
 except IOError as err:
  print(err)
 try:
  version = ('%s (rev %s)' % (version, check_output('git rev-parse --short HEAD', shell=True, cwd=root, stderr=STDOUT).strip()))
 except (IOError, CalledProcessError):
  pass
 return version

def _create_version ( ) : import os from subprocess import check_output , CalledProcessError , STDOUT version = 'Unknown' root = os . path . dirname ( os . path . abspath ( __file__ ) ) try : with open ( os . path . join ( root , 'VERSION.txt' ) , 'r' ) as f : version = f . read ( ) . strip ( ) except IOError as err : print ( err ) try : version = ( '%s (rev %s)' % ( version , check_output ( 'git rev-parse --short HEAD' , shell = True , cwd = root , stderr = STDOUT ) . strip ( ) ) ) except ( IOError , CalledProcessError ) : pass return version
helper function for building the version string .