Changeset 1892

Show
Ignore:
Timestamp:
17/11/08 22:37:42 (8 weeks ago)
Author:
duncan
svm:headrev:

cc3e1ea1-1e01-0410-8d68-8b121e83a9d5:11174
Message:

Figured out what the problem was with stopping the player menuw is None for the
second and later tracks, initializing the player once fixed this problem.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • freevo/src/audio/plugins/lastfm2.py

    r1883 r1892  
    3030 
    3131 
    32 import sys, os, time 
     32import sys, os, time, traceback 
    3333import md5, urllib, urllib2, httplib, re 
    3434from threading import Thread 
     
    5757 
    5858# Debugging modules 
    59 import pprint, traceback 
     59if config.DEBUG_DEBUGGER: 
     60    import pdb, pprint 
    6061 
    6162 
     
    181182    @benchmark(benchmarking, benchmarkcall) 
    182183    def shutdown(self): 
    183         pprint.pprint(self.__dict__) 
    184184        if self.webservices is not None: 
    185185            self.webservices.shutdown() 
     
    230230        if event == 'STOP': 
    231231            self.stop(self.arg, self.menuw) 
    232             return 
     232            return True 
    233233        if event == 'PLAY_START': 
    234234            pass 
     
    236236            if self.feed is not None and len(self.feed.entries) > 0: 
    237237                self.feed.entries.pop(0) 
    238             self.stop() 
    239238            self.play() 
    240239            return False 
     
    314313                        raise LastFMError('Failed to download track', entry.location_url) 
    315314                    time.sleep(0.1) 
    316                 self.player = PlayerGUI(self, menuw) 
     315                if not self.player: 
     316                    self.player = PlayerGUI(self, menuw) 
    317317                error = self.player.play() 
    318318                if error: 
     
    322322                    pop.destroy() 
    323323        except LastFMError, why: 
     324            traceback.print_exc() 
    324325            _debug_('play error: %s' % (why,), DWARNING) 
    325326            if menuw: 
     
    480481            return reply 
    481482        except urllib2.HTTPError, why: 
    482             _debug_('%s: %s' % (url, why)) 
     483            _debug_('%s: %s' % (url, why), DWARNING) 
    483484            raise LastFMError(why, url) 
    484485        except Exception, why: 
    485             _debug_('%s: %s' % (url, why)) 
    486             raise LastFMError(why, url) 
     486            _debug_('%s' % (why,), DWARNING) 
     487            raise LastFMError(why) 
    487488 
    488489