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
__version__ = "1.1.7"
__version__ = "1.1.8"

View File

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

View File

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