Skip to content

Commit 8259274

Browse files
committed
make it possible to override the disclaimer
1 parent b2e9491 commit 8259274

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

hpy/tools/autogen/autogenfile.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DISCLAIMER = """
1+
C_DISCLAIMER = """
22
/*
33
DO NOT EDIT THIS FILE!
44
@@ -7,22 +7,25 @@
77
make autogen
88
99
*/
10-
1110
"""
1211

1312
class AutoGenFile:
1413
LANGUAGE = 'C'
1514
PATH = None
15+
DISCLAIMER = None
1616

1717
def __init__(self, api):
18+
if self.DISCLAIMER is None and self.LANGUAGE == 'C':
19+
self.DISCLAIMER = C_DISCLAIMER
1820
self.api = api
1921

2022
def generate(self):
2123
raise NotImplementedError
2224

2325
def write(self, root):
2426
with root.join(self.PATH).open('w') as f:
25-
if self.LANGUAGE == 'C':
26-
f.write(DISCLAIMER)
27+
if self.DISCLAIMER is not None:
28+
f.write(self.DISCLAIMER)
29+
f.write('\n')
2730
f.write(self.generate())
2831
f.write('\n')

0 commit comments

Comments
 (0)