From a2b1a0a0a7e2a87d9e0a965307f5c553ede4d9a7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 20 Apr 2022 18:36:28 +0300 Subject: [PATCH] Use capitalize instead of title --- platformio/commands/lib/command.py | 8 ++++---- platformio/debug/config/factory.py | 2 +- platformio/package/commands/search.py | 2 +- platformio/package/vcsclient.py | 2 +- platformio/platform/factory.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platformio/commands/lib/command.py b/platformio/commands/lib/command.py index 54a58031..76210090 100644 --- a/platformio/commands/lib/command.py +++ b/platformio/commands/lib/command.py @@ -466,9 +466,9 @@ def lib_show(library, json_output): if key not in lib or not lib[key]: continue if isinstance(lib[key], list): - click.echo("%s: %s" % (key.title(), ", ".join(lib[key]))) + click.echo("%s: %s" % (key.capitalize(), ", ".join(lib[key]))) else: - click.echo("%s: %s" % (key.title(), lib[key])) + click.echo("%s: %s" % (key.capitalize(), lib[key])) blocks = [] @@ -622,9 +622,9 @@ def print_lib_item(item): if key not in item or not item[key]: continue if isinstance(item[key], list): - click.echo("%s: %s" % (key.title(), ", ".join(item[key]))) + click.echo("%s: %s" % (key.capitalize(), ", ".join(item[key]))) else: - click.echo("%s: %s" % (key.title(), item[key])) + click.echo("%s: %s" % (key.capitalize(), item[key])) for key in ("frameworks", "platforms"): if key not in item: diff --git a/platformio/debug/config/factory.py b/platformio/debug/config/factory.py index 6f9342ed..4741b800 100644 --- a/platformio/debug/config/factory.py +++ b/platformio/debug/config/factory.py @@ -23,7 +23,7 @@ class DebugConfigFactory(object): @staticmethod def get_clsname(name): name = re.sub(r"[^\da-z\_\-]+", "", name, flags=re.I) - return "%sDebugConfig" % name.lower().title() + return "%sDebugConfig" % name.lower().capitalize() @classmethod def new(cls, platform, project_config, env_name): diff --git a/platformio/package/commands/search.py b/platformio/package/commands/search.py index 57ec76ec..70b2d320 100644 --- a/platformio/package/commands/search.py +++ b/platformio/package/commands/search.py @@ -68,7 +68,7 @@ def print_search_item(item): item["type"].capitalize() if item["tier"] == "community" else click.style( - ("%s %s" % (item["tier"], item["type"])).title(), bold=True + ("%s %s" % (item["tier"], item["type"])).capitalize(), bold=True ), item["version"]["name"], util.parse_datetime(item["version"]["released_at"]).strftime("%c"), diff --git a/platformio/package/vcsclient.py b/platformio/package/vcsclient.py index ab404871..ed7434b0 100644 --- a/platformio/package/vcsclient.py +++ b/platformio/package/vcsclient.py @@ -47,7 +47,7 @@ class VCSClientFactory(object): if not type_: raise VCSBaseException("VCS: Unknown repository type %s" % remote_url) try: - obj = getattr(sys.modules[__name__], "%sClient" % type_.title())( + obj = getattr(sys.modules[__name__], "%sClient" % type_.capitalize())( src_dir, remote_url, tag, silent ) assert isinstance(obj, VCSClientBase) diff --git a/platformio/platform/factory.py b/platformio/platform/factory.py index 91fb8c9f..2df9e1b4 100644 --- a/platformio/platform/factory.py +++ b/platformio/platform/factory.py @@ -26,7 +26,7 @@ class PlatformFactory(object): @staticmethod def get_clsname(name): name = re.sub(r"[^\da-z\_]+", "", name, flags=re.I) - return "%sPlatform" % name.lower().title() + return "%sPlatform" % name.lower().capitalize() @staticmethod def load_module(name, path):