aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2018-03-03 16:24:55 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2018-03-03 16:24:55 +0300
commite39779086c60ddc3aca9c9f96d55a8de701f4ef2 (patch)
tree39ceec25b11850febd581424b7abc57bbb116411
parentfix Pylint warnings (diff)
downloadvk-scripts-e39779086c60ddc3aca9c9f96d55a8de701f4ef2.tar.gz
vk-scripts-e39779086c60ddc3aca9c9f96d55a8de701f4ef2.zip
"VK Mobile" instead of "the VK Mobile"
Diffstat (limited to '')
-rw-r--r--vk/platform.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/vk/platform.py b/vk/platform.py
index 7aebd9b..cd2c8d5 100644
--- a/vk/platform.py
+++ b/vk/platform.py
@@ -24,22 +24,24 @@ class Platform(Enum):
return str(self.value)
@staticmethod
- def _uppercase_first_letter(s):
+ 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._uppercase_first_letter(_PLATFORM_DESCRIPTIONS[self])
+ return self._capitalize_first_letter(_PLATFORM_DESCRIPTIONS[self])
def get_descr_text(self):
s = _PLATFORM_DESCRIPTIONS[self]
+ if self == self.VK_MOBILE:
+ return s
s = s.replace('unrecognized', 'an unrecognized')
return 'the ' + s
def get_descr_text_capitalized(self):
- return self._uppercase_first_letter(self.get_descr_text())
+ return self._capitalize_first_letter(self.get_descr_text())
_PLATFORM_DESCRIPTIONS = {
Platform.MOBILE: '"mobile" web version (or unrecognized mobile app)',