forked from nvlukasz/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyright.py
55 lines (43 loc) · 1.57 KB
/
copyright.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import glob
import os
python_header = """# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
"""
cpp_header = """/** Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
"""
dirs = [
"warp/*.py",
"warp/sim/*.py",
"warp/native/*.h",
"warp/native/*.cpp",
"warp/native/*.cu",
"exts/omni.warp/omni/warp/*.py",
"exts/omni.warp/omni/warp/nodes/*.py",
"tests/*.py",
]
for d in dirs:
paths = glob.glob(d)
for p in paths:
ext = os.path.splitext(p)[1]
if ext == ".py":
header = python_header
elif ext == ".cpp" or ext == ".cu" or ext == ".h":
header = cpp_header
f = open(p, "rt")
s = f.read()
f.close()
if not s.startswith(header):
s = header + s
f = open(p, "wt")
f.write(s)
f.close()