def verifyThirdPartyFile(url, checksum, fname):
 name = os.path.basename(fname)
 if os.path.exists(fname):
  print ('Using local copy of %s' % (name,))
 else:
  print ('Did not find local copy of %s' % (name,))
  print ('Downloading %s' % (name,))
  downloadURL(url, fname)
  print ('Archive for %s stored as %s' % (name, fname))
 if os.system(('MD5=$(openssl md5 %s) ; test "${MD5##*= }" = "%s"' % (shellQuote(fname), checksum))):
  fatal(('MD5 checksum mismatch for file %s' % fname))

def verifyThirdPartyFile ( url , checksum , fname ) : name = os . path . basename ( fname ) if os . path . exists ( fname ) : print ( 'Using local copy of %s' % ( name , ) ) else : print ( 'Did not find local copy of %s' % ( name , ) ) print ( 'Downloading %s' % ( name , ) ) downloadURL ( url , fname ) print ( 'Archive for %s stored as %s' % ( name , fname ) ) if os . system ( ( 'MD5=$(openssl md5 %s) ; test "${MD5##*= }" = "%s"' % ( shellQuote ( fname ) , checksum ) ) ) : fatal ( ( 'MD5 checksum mismatch for file %s' % fname ) )
download file from url to filename fname if it does not already exist .