예제 #1
0
def search():
    """
    #gets variables for the UI of the search queries

    """
    artist_name = ui.get_string('What is the name of the artist you are searching for?: ')
    album_title = ui.get_string('What is the name of the album you are looking for?: ')
    song_title = ui.get_string('What is the name of the song you are looking for?: ')
    follower_count = search_spotify(artist_name)
    lyrics = search_lyrics(artist_name, song_title)
    artwork = search_artwork(artist_name, album_title)

    results = {
        'artist_name': artist_name,
        'album_title': album_title,
        'song_title': song_title,
        'artwork': artwork,
        'lyrics': lyrics,
        'follower_count': follower_count
    }
    print_search_results(results)
    save = ui.save_bookmark()

    if save == True:
        save_new_bookmark(results)
    else:
        print('Okay this bookmark will not be saved')
예제 #2
0
def delete_tree():
    name = ui.get_string('Enter name of tree')
    deleted = database.delete_tree_by_name(name)
    if deleted:
        print('Tree was deleted')
    else:
        print('That tree was not in the database')
예제 #3
0
def add_tree():
    name = ui.get_string('Enter name of tree')
    max_height = ui.get_positive_float(f'Enter max height of {name}')
    try:
        database.add_tree(name, max_height)
        print('Added tree')
    except TreeError as e:
        print(e)
예제 #4
0
def get_name_and_email():
    name = ui.get_string('Enter artist name: ')
    email = ui.get_string('Enter artist email: ')
    return name, email
예제 #5
0
 def test_get_string_rejects_empty_inputs(self, mock_input):
     question = "Please enter a name:"
     self.assertEqual('some name', ui.get_string(question))
예제 #6
0
파일: artwork.py 프로젝트: yp0975eu/p3
def get_artwork_name():
    return ui.get_string('Enter artwork name: ')
예제 #7
0
파일: artwork.py 프로젝트: yp0975eu/p3
def get_artwork_price():
    return ui.get_string('Enter price: ')
예제 #8
0
 def test_get_string(self, mock):
     message = 'message'
     response = ui.get_string(message)
     self.assertTrue(response, 'fake_response')