def download_chrome_latest_rpm(arch):
chrome_rpm = 'google-chrome-%s_current_%s.rpm' % (version_string, arch)
path = 'https://dl.google.com/linux/direct/%s' % chrome_rpm
if (args.clean):
remove_file_if_exists(chrome_rpm)
# Let's make sure we haven't already downloaded it.
if os.path.isfile("./%s" % chrome_rpm):
print "%s already exists!" % chrome_rpm
else:
print "Downloading %s" % path
# Perhaps look at using python-progressbar at some point?
info=urllib.urlretrieve(path, chrome_rpm, reporthook=dlProgress)[1]
urllib.urlcleanup()
print ""
if (info["Content-Type"] != "binary/octet-stream" and info["Content-Type"] != "application/x-redhat-package-manager"):
print 'Chrome %s rpms are not on servers.' % version_string
remove_file_if_exists (chrome_rpm)
sys.exit(1)
# This is where the magic happens
chromium-latest.py 文件源码
python
阅读 39
收藏 0
点赞 0
评论 0
评论列表
文章目录