Fixed case change with words with less than 1 char

This fixes #21
This commit is contained in:
RemixDev 2020-07-13 12:54:45 +02:00
parent 22ffac188b
commit aa68190caa
3 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,3 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
__version__ = "1.1.7" __version__ = "1.1.8"

View File

@ -29,11 +29,17 @@ def changeCase(string, type):
string = string.split(" ") string = string.split(" ")
res = [] res = []
for index, value in enumerate(string): for index, value in enumerate(string):
if len(value) > 2:
res.append(value[0].upper() + value[1:].lower()) res.append(value[0].upper() + value[1:].lower())
else:
res.append(value.upper())
res = " ".join(res) res = " ".join(res)
return res return res
elif type == "sentence": elif type == "sentence":
if len(string) > 2:
res = string[0].upper() + string[1:].lower() res = string[0].upper() + string[1:].lower()
else:
res = string.upper()
return res return res
else: else:
return string return string

View File

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup( setup(
name="deemix", name="deemix",
version="1.1.7", version="1.1.8",
description="A barebone deezer downloader library", description="A barebone deezer downloader library",
long_description=README, long_description=README,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",