提交 c8c1b0d8 编写于 作者: L laiguizhong

修改param_cfg_to_code.py

Signed-off-by: Nlaiguizhong <laiguizhong@huawei.com>
上级 0e7cfe2d
...@@ -64,11 +64,14 @@ def GetParamFromCCode(codeName): ...@@ -64,11 +64,14 @@ def GetParamFromCCode(codeName):
if len(name) != 0 and len(value) != 0: if len(name) != 0 and len(value) != 0:
dict[name] = value dict[name] = value
data = afile.readline() data = afile.readline()
afile.truncate(0)
return dict return dict
def WriteMapToCode(codeName, dict): def WriteMapToCode(codeName, dict):
try: try:
f = open(codeName, 'w') f = open(codeName, 'w')
# start with 0
f.seek(0)
# write file header # write file header
f.write('#ifndef PARAM_LITE_DEF_CFG_' + os.linesep) f.write('#ifndef PARAM_LITE_DEF_CFG_' + os.linesep)
f.write('#define PARAM_LITE_DEF_CFG_' + os.linesep) f.write('#define PARAM_LITE_DEF_CFG_' + os.linesep)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册