2 Star 0 Fork 0

chromium_develop/chromium_tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
accessibility
android
binary_size
bisect_repackage
cfi
check_ecs_deps
checkbins
checklicenses
checkperms
checkteamtags
chrome_extensions/open_my_editor
clang
code_coverage
compile_test
coverity
cr
cros
cygprofile
determinism
diagnosis
dromaeo_benchmark_runner
dump_process_memory
emacs
find_runtime_symbols
flags
flakiness
fuchsia
gdb
generate_library_loader
generate_shim_headers
generate_stubs
get_swarming_logs
git
gn
grit
gritsettings
idl_parser
imagediff
infra
ipc_fuzzer
json_comment_eater
json_schema_compiler
json_to_struct
l10n
linux
lldb
luci-go
mac
mb
md_browser
media_engagement_preload
memory
memory_inspector
metrics
msan
oopif
origin_trials
page_cycler
perf
polymer
privacy_budget
protoc_wrapper
python
real_world_impact
resources
resultdb
security
site_compare
skia_goldctl/linux
stats_viewer
strict_enum_value_checker
style_variable_generator
sublime
swarming_client
symsrc
tcmalloc
tests
traceline
traffic_annotation
translation
ubsan
usb_gadget
v8_context_snapshot
valgrind
variations
vim
vscode
web_bluetooth
web_dev_style
win
.style.yapf
DEPS
DIR_METADATA
OWNERS
README.en.md
README.md
auto-nav.py
autotest.py
bash-completion
bisect-builds.py
bisect_test.py
boilerplate.py
buildstate.bat
buildstate.py
check_git_config.py
check_grd_for_unused_strings.py
clang-format-js
diagnose-me.py
download_optimization_profile.py
gypv8sh.py
include_tracer.py
ipc_messages_log.py
licenses.py
make-gtest-filter.py
multi_process_rss.py
nocompile_driver.py
omahaproxy.py
perry.py
remove_duplicate_includes.py
remove_stale_pyc_files.py
roll_webgl_conformance.py
run-swarmed.py
sort-headers.py
sort_sources.py
uberblame.py
unused-symbols-report.py
update_pgo_profiles.py
yes_no.py
克隆/下载
omahaproxy.py 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
李想 提交于 3年前 . chromium origin init
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chrome Version Tool
Scrapes Chrome channel information and prints out the requested nugget of
information.
"""
from __future__ import print_function
import json
import optparse
import os
import string
import sys
import urllib
URL = 'https://omahaproxy.appspot.com/json'
def main():
try:
data = json.load(urllib.urlopen(URL))
except Exception as e:
print('Error: could not load %s\n\n%s' % (URL, str(e)))
return 1
# Iterate to find out valid values for OS, channel, and field options.
oses = set()
channels = set()
fields = set()
for os_versions in data:
oses.add(os_versions['os'])
for version in os_versions['versions']:
for field in version:
if field == 'channel':
channels.add(version['channel'])
else:
fields.add(field)
oses = sorted(oses)
channels = sorted(channels)
fields = sorted(fields)
# Command line parsing fun begins!
usage = ('%prog [options]\n'
'Print out information about a particular Chrome channel.')
parser = optparse.OptionParser(usage=usage)
parser.add_option('-o', '--os',
choices=oses,
default='win',
help='The operating system of interest: %s '
'[default: %%default]' % ', '.join(oses))
parser.add_option('-c', '--channel',
choices=channels,
default='stable',
help='The channel of interest: %s '
'[default: %%default]' % ', '.join(channels))
parser.add_option('-f', '--field',
choices=fields,
default='version',
help='The field of interest: %s '
'[default: %%default] ' % ', '.join(fields))
(opts, args) = parser.parse_args()
# Print out requested data if available.
for os_versions in data:
if os_versions['os'] != opts.os:
continue
for version in os_versions['versions']:
if version['channel'] != opts.channel:
continue
if opts.field not in version:
continue
print(version[opts.field])
return 0
print('Error: unable to find %s for Chrome %s %s.' % (opts.field, opts.os,
opts.channel))
return 1
if __name__ == '__main__':
sys.exit(main())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chromium_develop/chromium_tools.git
git@gitee.com:chromium_develop/chromium_tools.git
chromium_develop
chromium_tools
chromium_tools
master

搜索帮助