~pyjamateam/pyjama/main

« back to all changes in this revision

Viewing changes to release/src/plugins/lastfm/__init__.py

  • Committer: Sebastian Kalinowski
  • Date: 2009-09-26 13:51:17 UTC
  • Revision ID: beton@demonek.com-20090926135117-v92j32js62lkj8zi
Now some plugins will work with Python 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        t.start()
33
33
    return wrapper
34
34
 
35
 
@threaded
 
35
#@threaded
36
36
class main():
37
37
    ## The Constructor
38
38
    # @param self Object pointer
61
61
#    def get_session(self):
62
62
#        thr = Thread(target = self.get_session_do, args = ())
63
63
#        thr.start()
64
 
 
 
64
    @threaded
65
65
    def get_session(self):
66
66
        if self.pyjama.settings.get_value('LASTFM','SCROBBLING'):
67
67
 
86
86
#    def ev_nowplaying(self,track):
87
87
#        thr = Thread(target = self.ev_nowplaying_do, args = (track,))
88
88
#        thr.start()
89
 
 
 
89
    @threaded
90
90
    def ev_nowplaying(self, track):
91
91
        """ for sending now playing notification to last.fm """
92
92
        logging.debug('nowplaying: %s' % track)
112
112
#    def ev_scrobble(self,track):
113
113
#        thr = Thread(target = self.ev_scrobble_do, args = (track,))
114
114
#        thr.start()
115
 
 
 
115
    @threaded
116
116
    def ev_scrobble(self,track):
117
117
        """ for scrobbling to last.fm """
118
118
        logging.debug('track: %s' % track)
137
137
 
138
138
        else:
139
139
            logging.debug('song doesn\' scrobbled - scrobbling is off')
140
 
 
 
140
    @threaded
141
141
    def ev_player_status(self, status, cursec = None, duration = None):
142
142
        if status == "playing":
143
143
            percentage =  (1.0 / duration) * cursec