Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove whitespace error in custom schemes #62

Merged
merged 2 commits into from
Mar 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spotirec.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ def print_choices(data=None, prompt=True, sort=False) -> str:
input_string = input('Enter integer identifiers for 1-5 whitespace separated selections that you wish to '
'include [default: top 5]:\n') or '0 1 2 3 4'
if 'genres' in rec.seed_type:
parse_seed_info([data[int(x)] for x in input_string.split(' ')])
parse_seed_info([data[int(x)] for x in input_string.strip(' ').split(' ')])
else:
return input_string
return input_string.strip(' ')


def print_artists_or_tracks(data: json, prompt=True):
Expand Down Expand Up @@ -501,7 +501,7 @@ def prompt_name() -> str:
try:
inp = input('Enter an identifier for your device: ')
assert inp
return inp
return inp.strip(' ')
except AssertionError:
prompt_name()

Expand Down Expand Up @@ -701,7 +701,7 @@ def parse():
if not user_input:
print('Please enter 1-5 seeds')
exit(1)
parse_seed_info(user_input)
parse_seed_info(user_input.strip(' '))
else:
print(f'Basing recommendations off your top {args.n} genres')
add_top_genres_seed(args.n)
Expand Down