diff --git a/.coveragerc b/.coveragerc index 56ad921c..b299f5ba 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,5 +10,5 @@ exclude_lines = if __name__ == .__main__.: ignore_errors = True omit = - swaglyrics/tests.py + tests/* setup.py diff --git a/.travis.yml b/.travis.yml index 105d3b8d..645fef9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,13 @@ python: # command to install dependencies install: - pip install . + - pip install blinker + - pip install flask_testing - pip install codecov - pip install nose-cov # command to run tests -script: +script: - nosetests --nocapture --with-cov --cov-config .coveragerc after_success: - - codecov \ No newline at end of file +- codecov diff --git a/swaglyrics/cli.py b/swaglyrics/cli.py index b4c91e4a..15d8dd17 100644 --- a/swaglyrics/cli.py +++ b/swaglyrics/cli.py @@ -68,11 +68,12 @@ def get_lyrics(song, artist, make_issue=True): return lyrics -def lyrics(song, artist): +def lyrics(song, artist, make_issue=True): """ Displays the fetched lyrics if song playing. :param song: currently playing song :param artist: song artist + :param make_issue: whether to make an issue on GitHub if song unsupported :return: lyrics if song playing """ if song and artist: # check if song playing @@ -83,7 +84,7 @@ def lyrics(song, artist): except FileNotFoundError: pass print('\nGetting lyrics for {song} by {artist}\n'.format(song=song, artist=artist), end='') - lyrics = get_lyrics(song, artist) + lyrics = get_lyrics(song, artist, make_issue) for _ in range(30): # loading spinner sys.stdout.write(next(spinner)) sys.stdout.flush() diff --git a/swaglyrics/tab.py b/swaglyrics/tab.py index 0da54344..6bd94731 100644 --- a/swaglyrics/tab.py +++ b/swaglyrics/tab.py @@ -3,7 +3,7 @@ import os from swaglyrics import spotify -app = Flask(__name__, template_folder=os.path.join(os.path.dirname(os.path.abspath('tab.py')), 'templates')) +app = Flask(__name__, template_folder=os.path.join(os.path.dirname(os.path.abspath('SwagLyrics-For-Spotify')), 'swaglyrics/templates')) # use relative path of the template folder song = None