From 7460e4ccda339d167402bd077dcaa364fab5e172 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 25 Nov 2019 12:05:19 -0800 Subject: compilers: Make get_display_language a class or static method Currently this is done at the instance level, but we need it at the class level to allow compiler "lang" args to be gotten early enough. This patch also removes a couple of instance of branch/leaf classes providing their own implementation that is identical to the Compiler version. --- mesonbuild/compilers/compilers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index eedd4cf..713a9e7 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -731,8 +731,9 @@ class Compiler: def get_language(self) -> str: return self.language - def get_display_language(self) -> str: - return self.language.capitalize() + @classmethod + def get_display_language(cls) -> str: + return cls.language.capitalize() def get_default_suffix(self) -> str: return self.default_suffix -- cgit v1.1