We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2e9491 commit 8259274Copy full SHA for 8259274
hpy/tools/autogen/autogenfile.py
@@ -1,4 +1,4 @@
1
-DISCLAIMER = """
+C_DISCLAIMER = """
2
/*
3
DO NOT EDIT THIS FILE!
4
@@ -7,22 +7,25 @@
7
make autogen
8
9
*/
10
-
11
"""
12
13
class AutoGenFile:
14
LANGUAGE = 'C'
15
PATH = None
+ DISCLAIMER = None
16
17
def __init__(self, api):
18
+ if self.DISCLAIMER is None and self.LANGUAGE == 'C':
19
+ self.DISCLAIMER = C_DISCLAIMER
20
self.api = api
21
22
def generate(self):
23
raise NotImplementedError
24
25
def write(self, root):
26
with root.join(self.PATH).open('w') as f:
- if self.LANGUAGE == 'C':
- f.write(DISCLAIMER)
27
+ if self.DISCLAIMER is not None:
28
+ f.write(self.DISCLAIMER)
29
+ f.write('\n')
30
f.write(self.generate())
31
f.write('\n')
0 commit comments