Use builtin "title()"

This commit is contained in:
Ivan Kravets
2022-04-19 11:33:56 +03:00
parent df3a13fc61
commit 9ce0b0e25b
2 changed files with 2 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class DebugConfigFactory(object):
@staticmethod
def get_clsname(name):
name = re.sub(r"[^\da-z\_\-]+", "", name, flags=re.I)
return "%s%sDebugConfig" % (name.upper()[0], name.lower()[1:])
return "%sDebugConfig" % name.lower().title()
@classmethod
def new(cls, platform, project_config, env_name):

View File

@@ -26,7 +26,7 @@ class PlatformFactory(object):
@staticmethod
def get_clsname(name):
name = re.sub(r"[^\da-z\_]+", "", name, flags=re.I)
return "%s%sPlatform" % (name.upper()[0], name.lower()[1:])
return "%sPlatform" % name.lower().title()
@staticmethod
def load_module(name, path):