2023-01-31 12:18:52 +00:00
|
|
|
def unify(string: str) -> str:
|
|
|
|
"""
|
|
|
|
returns an unified str, to make comparosons easy.
|
|
|
|
an unified string has following attributes:
|
|
|
|
- is lowercase
|
|
|
|
"""
|
|
|
|
|
|
|
|
return string.lower()
|
2023-04-03 09:17:55 +00:00
|
|
|
|
|
|
|
def fit_to_file_system(string: str) -> str:
|
|
|
|
string = string.strip()
|
|
|
|
|
|
|
|
while string[0] == ".":
|
|
|
|
if len(string) == 0:
|
|
|
|
return string
|
|
|
|
|
|
|
|
string = string[1:]
|
|
|
|
|
|
|
|
string = string.replace("/", "|").replace("\\", "|")
|
|
|
|
|
|
|
|
return string
|
2023-01-31 12:18:52 +00:00
|
|
|
|