1 Star 0 Fork 0

镜像库/flower

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ver.py 799 Bytes
一键复制 编辑 原始数据 按行查看 历史
nur 提交于 2020-07-27 05:51 . Rename variable prefixes
from datetime import datetime
from os.path import dirname, join
cwd = dirname(__file__)
now = datetime.now()
dt_string = now.strftime("%d/%m/%Y %H:%M")
print("date and time =", dt_string)
with open(join(cwd, './Source/version.c'), 'w') as f:
chars = ["'{0}'".format(char) for char in dt_string]
f.write("""
#ifndef ZCL_APP_VERSION_H
#define ZCL_APP_VERSION_H
#ifdef __cplusplus
extern "C" {
#endif
"""
)
f.write('#include "version.h"\n')
code = """const uint8 zclApp_DateCode[] = {{ {0}, {1} }};\n""".format(len(chars), ', '.join(chars))
f.write(code)
code = """const char zclApp_DateCodeNT[] = \"{0}\";\n""".format(dt_string)
f.write(code)
f.write("""
#ifdef __cplusplus
}
#endif
#endif /* ZCL_APP_VERSION_H */
""")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dlcmirrors/flower.git
git@gitee.com:dlcmirrors/flower.git
dlcmirrors
flower
flower
master

搜索帮助