15 Star 89 Fork 47

hpmicro/hpm_sdk

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
get_min_sdk_version.py 764 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ryan QIAN 提交于 2024-09-30 15:34 +08:00 . hpm sdk release v1.7.0
# Copyright (c) 2023 HPMicro
# SPDX-License-Identifier: BSD-3-Clause
import sys
import yaml
MIN_SDK_VERSION="minimum_sdk_version"
def get_min_sdk_version(input_yml):
min_version = ""
with open(input_yml, "r", encoding="utf-8", errors="ignore") as stream:
try:
info = yaml.safe_load(stream)
if not info is None and MIN_SDK_VERSION in info.keys() and info[MIN_SDK_VERSION] is not None:
for t in info[MIN_SDK_VERSION]:
min_version = (t.strip().lower())
except yaml.YAMLError as e:
pass
stream.close()
if len(min_version):
sys.stdout.write("%s\n" % (min_version))
return min_version
if __name__ == "__main__":
get_min_sdk_version(sys.argv[1])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hpmicro/hpm_sdk.git
git@gitee.com:hpmicro/hpm_sdk.git
hpmicro
hpm_sdk
hpm_sdk
main

搜索帮助