fixed unicode bs
This commit is contained in:
parent
3acfa417e8
commit
1f0ff801d8
@ -41,13 +41,15 @@ EXIT_COMMANDS = {
|
|||||||
"quit"
|
"quit"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def print_cute_message():
|
def print_cute_message():
|
||||||
message = get_random_message()
|
message = get_random_message()
|
||||||
try:
|
try:
|
||||||
print(message)
|
print(message)
|
||||||
except UnicodeDecodeError:
|
except UnicodeEncodeError:
|
||||||
print((c for c in message if 0 < ord(c) < 127))
|
print((c for c in message if 0 < ord(c) < 127))
|
||||||
|
|
||||||
|
|
||||||
def cli(genre: str = None, download_all: bool = False):
|
def cli(genre: str = None, download_all: bool = False):
|
||||||
def get_existing_genre() -> List[str]:
|
def get_existing_genre() -> List[str]:
|
||||||
"""
|
"""
|
||||||
@ -73,8 +75,7 @@ def cli(genre: str = None, download_all: bool = False):
|
|||||||
def get_genre():
|
def get_genre():
|
||||||
existing_genres = get_existing_genre()
|
existing_genres = get_existing_genre()
|
||||||
for i, genre_option in enumerate(existing_genres):
|
for i, genre_option in enumerate(existing_genres):
|
||||||
print(f"{i+1:0>2}: {genre_option}")
|
print(f"{i + 1:0>2}: {genre_option}")
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
genre = input("Id or new genre: ")
|
genre = input("Id or new genre: ")
|
||||||
@ -82,7 +83,7 @@ def cli(genre: str = None, download_all: bool = False):
|
|||||||
if genre.isdigit():
|
if genre.isdigit():
|
||||||
genre_id = int(genre) - 1
|
genre_id = int(genre) - 1
|
||||||
if genre_id >= len(existing_genres):
|
if genre_id >= len(existing_genres):
|
||||||
print(f"No genre under the id {genre_id+1}.")
|
print(f"No genre under the id {genre_id + 1}.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return existing_genres[genre_id]
|
return existing_genres[genre_id]
|
||||||
|
Loading…
Reference in New Issue
Block a user