def set_version():
 fnull = open(os.devnull, 'w')
 process = subprocess.call(['/usr/bin/dpkg-query', '-l', 'rbp-mediacenter-osmc'], stderr=fnull, stdout=fnull)
 fnull.close()
 if (process == 0):
  version_string = 'Unsupported OSMC Alpha release'
 else:
  version = []
  with open('/etc/os-release', 'r') as f:
   tags = ['NAME=', 'VERSION=', 'VERSION_ID=']
   lines = f.readlines()
   for line in lines:
    for tag in tags:
     if line.startswith(tag):
      version.append(line[len(tag):].replace('"', '').replace('\n', ''))
  version_string = ' '.join(version)
 log(('Current Version: %s' % version_string))
 WINDOW.setProperty('osmc_version', version_string)

def set_version ( ) : fnull = open ( os . devnull , 'w' ) process = subprocess . call ( [ '/usr/bin/dpkg-query' , '-l' , 'rbp-mediacenter-osmc' ] , stderr = fnull , stdout = fnull ) fnull . close ( ) if ( process == 0 ) : version_string = 'Unsupported OSMC Alpha release' else : version = [ ] with open ( '/etc/os-release' , 'r' ) as f : tags = [ 'NAME=' , 'VERSION=' , 'VERSION_ID=' ] lines = f . readlines ( ) for line in lines : for tag in tags : if line . startswith ( tag ) : version . append ( line [ len ( tag ) : ] . replace ( '"' , '' ) . replace ( '\n' , '' ) ) version_string = ' ' . join ( version ) log ( ( 'Current Version: %s' % version_string ) ) WINDOW . setProperty ( 'osmc_version' , version_string )
loads the current osmc version into the home window for display in myosmc .