Ai
2 Star 0 Fork 0

mirrors_IntelPython/numba-dppy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
update_copyrights.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
import os
import subprocess
def update_copyrights(root_dir, year):
for folder, _, files in os.walk(root_dir):
for filename in files:
if filename[0] != "." and os.path.splitext(filename)[1] in [
".py",
".h",
".c",
".cpp",
]:
filePath = os.path.abspath(os.path.join(folder, filename))
args = [
"annotate",
"--copyright=Intel Corporation",
"--license=Apache-2.0",
"--year",
str(year),
"--merge-copyrights",
filePath,
]
subprocess.check_call(
["reuse", *args],
shell=False,
)
path = os.path.dirname(os.path.realpath(__file__))
source_path = os.path.dirname(path)
if __name__ == "__main__":
print("Provide new copyright year:")
year = input()
update_copyrights(source_path + "/numba_dpex", year)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_IntelPython/numba-dppy.git
git@gitee.com:mirrors_IntelPython/numba-dppy.git
mirrors_IntelPython
numba-dppy
numba-dppy
main

搜索帮助