1 Star 0 Fork 0

openbmc/openpower-vpd-parser

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
extra-properties.py 937 Bytes
一键复制 编辑 原始数据 按行查看 历史
Patrick Williams 提交于 2022-12-08 06:18 . black: re-format
#!/usr/bin/env python3
import argparse
import os
import yaml
from mako.template import Template
def main():
parser = argparse.ArgumentParser(
description="OpenPOWER FRU VPD parser and code generator"
)
parser.add_argument(
"-e",
"--extra_props_yaml",
dest="extra_props_yaml",
default="extra-properties-example.yaml",
help="input extra properties yaml file to parse",
)
args = parser.parse_args()
with open(os.path.join(script_dir, args.extra_props_yaml), "r") as fd:
yamlDict = yaml.safe_load(fd)
# Render the mako template
template = os.path.join(script_dir, "extra-properties.mako.hpp")
t = Template(filename=template)
with open("extra-properties-gen.hpp", "w") as fd:
fd.write(t.render(dict=yamlDict))
if __name__ == "__main__":
script_dir = os.path.dirname(os.path.realpath(__file__))
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openbmc_masterhu/openpower-vpd-parser.git
git@gitee.com:openbmc_masterhu/openpower-vpd-parser.git
openbmc_masterhu
openpower-vpd-parser
openpower-vpd-parser
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385