~jconti/ubuntu/precise/emesene/fix-956422

« back to all changes in this revision

Viewing changes to plugins_base/currentSong/Amarok2.py

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2010-04-14 01:33:51 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100414013351-r2icbt5gs4ai71j8
Tags: 1.6.1-0ubuntu1
* New upstream release (LP: #562646).
* Fix missing-debian-source-format lintian warning.
* Refresh 20_dont_build_own_libmimic.patch patch.
* Bump Standards-Version to 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        self.iface = self.bus.get_object(IFACE_NAME, IFACE_PATH)
46
46
 
47
47
    def isPlaying( self ):
48
 
        isPlayingiface = self.bus.get_object(IFACE_NAME, '/Player')
49
 
        if isPlayingiface:
50
 
            status = isPlayingiface.GetStatus()
51
 
            if status[0] == 0:
52
 
                return True
53
 
            else:
54
 
                return False
 
48
        if self.iface:
 
49
            isPlayingiface = self.bus.get_object(IFACE_NAME, '/Player')
 
50
            if isPlayingiface:
 
51
                status = isPlayingiface.GetStatus()
 
52
                if status[0] == 0:
 
53
                    return True
 
54
                else:
 
55
                    return False
 
56
        return False
55
57
            
56
 
 
57
 
    def getStatus(self):
58
 
        '''Check if everything is ok to start the plugin'''
59
 
        if os.name != 'posix':
60
 
            return (False, _('This plugin only works in posix systems'))
61
 
 
62
 
        if not self.iface:
63
 
            return (False, _('You don\'t have dbus.'))
64
 
 
65
 
        return (True, 'Ok')
66
 
 
67
 
    def getCurrentSong(self):
68
 
        if self.iface:
69
 
            if self.isPlaying():
70
 
                current_track = self.iface.GetCurrentTrack()
71
 
                current_song = self.iface.GetMetadata(current_track)
72
 
                self.artist = current_song['artist']
73
 
                self.title = current_song['title']
74
 
                self.album = current_song['album']
75
 
                #self.filename = current_song['filename']
76
 
            return self.parseStyle()
77
 
 
78
58
    def check(self):
79
59
        if self.isPlaying():
80
60
            current_track = self.iface.GetCurrentTrack()