1 Star 0 Fork 29

wuxinzao/chromium_third_party_skia

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gerrit_percent_encode 758 Bytes
一键复制 编辑 原始数据 按行查看 历史
李想 提交于 2023-08-12 10:59 +08:00 . chromium 99.0.4844.88 origin init
#! /usr/bin/env python
# Copyright 2019 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import sys
def gerrit_percent_encode(value):
'''
https://gerrit-review.googlesource.com/Documentation/user-upload.html
"To avoid confusion in parsing the git ref, at least the following characters
must be percent-encoded: " %^@.~-+_:/!". Note that some of the reserved
characters (like tilde) are not escaped in the standard URL encoding rules..."
'''
good = re.compile('^[A-Za-z0-9]$')
return ''.join(c if good.match(c) else '%%%02X' % ord(c) for c in value)
if __name__ == '__main__':
sys.stdout.write(gerrit_percent_encode(' '.join(sys.argv[1:])) + '\n')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuxinzao/chromium_third_party_skia.git
git@gitee.com:wuxinzao/chromium_third_party_skia.git
wuxinzao
chromium_third_party_skia
chromium_third_party_skia
master

搜索帮助