代码拉取完成,页面将自动刷新
import os
version = input("input version:")
version_info = []
print("version info:")
while True:
tmp_info = input()
if tmp_info == "exit":
break
version_info.append(tmp_info)
add_info = '''
/**
* @version ''' + version + '''
* @author skyfire
* @mail skyfireitdiy@hotmail.com
* @see http://github.com/skyfireitdiy/sflib
'''
last_msg = '\n* ' + '\n* '.join(version_info) + '\n*/\n\n'
comfirm = input("input yes to continue:")
if comfirm != "yes":
exit(0)
g = os.walk(".")
for path,dir_list,file_list in g:
for file_name in file_list:
name = os.path.join(path, file_name)
if name.endswith(".h") or name.endswith(".hpp") or name.endswith(".cpp"):
new_content = ""
with open(name, 'r') as fp:
content = fp.read()
new_info = add_info + '''* @file '''+ file_name + '\n'
new_content = new_info + last_msg + content
if len(new_content) != 0:
with open(name, 'w') as fp:
fp.write(new_content)
print(name + " resolved")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。