(self)
| 56 | """An object that encapsulates the compat-level of our build. |
| 57 | """ |
| 58 | def __init__(self): |
| 59 | makefile = os.path.join(os.path.dirname(__file__), "..", "Makefile") |
| 60 | lines = [l for l in open(makefile, 'r') if l.startswith('COMPAT_CFLAGS')] |
| 61 | assert(len(lines) == 1) |
| 62 | line = lines[0] |
| 63 | flags = re.findall(r'COMPAT_V([0-9]+)=1', line) |
| 64 | self.compat_flags = flags |
| 65 | |
| 66 | def __call__(self, version): |
| 67 | return COMPAT and version in self.compat_flags |