summaryrefslogtreecommitdiff
path: root/mesonbuild/templates/cpptemplates.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-06-30 14:33:43 -0700
committerEli Schwartz <eschwartz93@gmail.com>2023-07-25 15:50:21 -0400
commitd0729bde02a4fd7708fc9fce2dd779e9fb9ab342 (patch)
treeef096e5f97010ee8e0cfc774a35b088409cbe055 /mesonbuild/templates/cpptemplates.py
parent3fdc877e8a971b3849784797dcc87045aefcd42a (diff)
downloadmeson-d0729bde02a4fd7708fc9fce2dd779e9fb9ab342.tar.gz
templates: move initializer to base class
Every class implements the exact same initializer, simplify this by putting it in the base class initializer
Diffstat (limited to 'mesonbuild/templates/cpptemplates.py')
-rw-r--r--mesonbuild/templates/cpptemplates.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/mesonbuild/templates/cpptemplates.py b/mesonbuild/templates/cpptemplates.py
index 6e9776180..75a5ee256 100644
--- a/mesonbuild/templates/cpptemplates.py
+++ b/mesonbuild/templates/cpptemplates.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
+
hello_cpp_template = '''#include <iostream>
@@ -143,10 +144,6 @@ pkg_mod.generate(
class CppProject(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())