comparison src/plugins/plugin_misc_radiocol.py @ 941:c6d8fc63b1db

core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 18:07:02 +0100
parents c3fdf187a73a
children 301b342c697a
comparison
equal deleted inserted replaced
940:92e41e7c7e00 941:c6d8fc63b1db
97 """ 97 """
98 #XXX: this is a Q&D way for the proof of concept. In the future, the song should 98 #XXX: this is a Q&D way for the proof of concept. In the future, the song should
99 # be streamed to the backend using XMPP file copy 99 # be streamed to the backend using XMPP file copy
100 # Here we cheat because we know we are on the same host, and we don't 100 # Here we cheat because we know we are on the same host, and we don't
101 # check data. Referee will have to parse the song himself to check it 101 # check data. Referee will have to parse the song himself to check it
102 client = self.host.getClient(profile)
103 if not client:
104 raise exceptions.NotConnectedProfileError(_("Can't access profile's data"))
105 try: 102 try:
106 if song_path.lower().endswith('.mp3'): 103 if song_path.lower().endswith('.mp3'):
107 actual_song = MP3(song_path) 104 actual_song = MP3(song_path)
108 try: 105 try:
109 song = EasyID3(song_path) 106 song = EasyID3(song_path)