From c7325abd5b019d82076aa69a793f88ff044ab1a9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 23 Jun 2026 17:33:05 +0200 Subject: use properties instead of stupid get/set methods --- vk/platform.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'vk/platform.py') diff --git a/vk/platform.py b/vk/platform.py index e7ca38a..2664c39 100644 --- a/vk/platform.py +++ b/vk/platform.py @@ -24,22 +24,10 @@ class Platform(Enum): def __str__(self): return str(self.value) - @staticmethod - def _capitalize_first_letter(s): - m = re.search(r'\w', s) - if m is None: - return s - return s[: m.start()] + m.group().upper() + s[m.end() :] - - def get_descr_header(self): - return self._capitalize_first_letter(_PLATFORM_DESCRIPTIONS[self]) - - def get_descr_text(self): + @property + def descr(self): return f'the {_PLATFORM_DESCRIPTIONS[self]}' - def get_descr_text_capitalized(self): - return self._capitalize_first_letter(self.get_descr_text()) - _PLATFORM_DESCRIPTIONS = { Platform.MOBILE: '"mobile" web version (or an unrecognized mobile app)', -- cgit v1.3