From d0729bde02a4fd7708fc9fce2dd779e9fb9ab342 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 30 Jun 2023 14:33:43 -0700 Subject: templates: move initializer to base class Every class implements the exact same initializer, simplify this by putting it in the base class initializer --- mesonbuild/templates/objcpptemplates.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'mesonbuild/templates/objcpptemplates.py') diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py index 450f2b030..4ec785c18 100644 --- a/mesonbuild/templates/objcpptemplates.py +++ b/mesonbuild/templates/objcpptemplates.py @@ -13,9 +13,10 @@ # limitations under the License. from __future__ import annotations -from mesonbuild.templates.sampleimpl import SampleImpl import re +from mesonbuild.templates.sampleimpl import SampleImpl + lib_h_template = '''#pragma once #if defined _WIN32 || defined __CYGWIN__ @@ -126,10 +127,6 @@ test('basic', exe) class ObjCppProject(SampleImpl): - def __init__(self, options): - super().__init__() - self.name = options.name - self.version = options.version def create_executable(self) -> None: lowercase_token = re.sub(r'[^a-z0-9]', '_', self.name.lower()) -- cgit v1.2.3