diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-05-27 20:23:30 -0400 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-05-27 20:23:30 -0400 |
| commit | e3f46a7a9222d951141ca6b6a932891ae7b20079 (patch) | |
| tree | 01ec3ebfbf9492198b07f8e280b6d8eca47cc03a /client/conversation.py | |
| parent | d0c909dab1a06f5970216befd2cd0839327914fe (diff) | |
| parent | 5deb1799cefe9351b90d3457898990d454d4a4dc (diff) | |
| download | jasper-client-e3f46a7a9222d951141ca6b6a932891ae7b20079.tar.gz jasper-client-e3f46a7a9222d951141ca6b6a932891ae7b20079.zip | |
fixed merge conflicts
Diffstat (limited to 'client/conversation.py')
| -rwxr-xr-x | client/conversation.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/conversation.py b/client/conversation.py index 6e994a2..29a8e89 100755 --- a/client/conversation.py +++ b/client/conversation.py @@ -1,7 +1,7 @@ from notifier import Notifier from musicmode import * from brain import Brain - +from mpd import MPDClient class Conversation(object): @@ -17,6 +17,16 @@ class Conversation(object): # check if input is meant to start the music module if any(x in text.upper() for x in ["SPOTIFY","MUSIC"]): + # check if mpd client is running + try: + client = MPDClient() + client.timeout = None + client.idletimeout = None + client.connect("localhost", 6600) + except: + self.mic.say("I'm sorry. It seems that Spotify is not enabled. Please read the documentation to learn how to configure Spotify.") + return + self.mic.say("Please give me a moment, I'm loading your Spotify playlists.") music_mode = MusicMode(self.persona, self.mic) music_mode.handleForever() |
