~ubuntu-branches/ubuntu/quantal/rhythmbox/quantal-proposed

« back to all changes in this revision

Viewing changes to plugins/magnatune/MagnatuneSource.py

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2011-09-09 14:13:24 UTC
  • mfrom: (1.1.59 upstream)
  • Revision ID: package-import@ubuntu.com-20110909141324-72ef36aetwiidw8e
Tags: 2.90.1~20110908-0ubuntu1
* New upstream git snapshot up to commit
  31e8e0e6b3a4af101f60b5733e0cfdd736f3dd6d
* reverted commit "visualizer: add colorspace converter so it works 
  with playbin2" (d9fe72447999c2777ddc053dfa28ff363e84336d) and 
  "visualizer: new clutter-based visualizer plugin"
  (082eaf958b60e3830f1607114353d777c930d616) to prevent dependency on
  clutter-gst which is in universe

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
27
27
 
28
28
import os
29
 
import gobject
30
29
import xml
31
30
import urllib
32
31
import urlparse
36
35
 
37
36
import rb
38
37
from gi.repository import RB
39
 
from gi.repository import Gtk, Gio
 
38
from gi.repository import GObject, Gtk, Gio
40
39
# XXX use GnomeKeyring when introspection is available
41
40
 
42
41
from TrackListHandler import TrackListHandler
65
64
                # source state
66
65
                self.__activated = False
67
66
                self.__db = None
68
 
                self.__notify_id = 0 # gobject.idle_add id for status notifications
 
67
                self.__notify_id = 0 # GObject.idle_add id for status notifications
69
68
                self.__info_screen = None # the loading screen
70
69
 
71
70
                # track data
76
75
                # catalogue stuff
77
76
                self.__updating = True # whether we're loading the catalog right now
78
77
                self.__has_loaded = False # whether the catalog has been loaded yet
79
 
                self.__update_id = 0 # gobject.idle_add id for catalog updates
 
78
                self.__update_id = 0 # GObject.idle_add id for catalog updates
80
79
                self.__catalogue_loader = None
81
80
                self.__catalogue_check = None
82
81
                self.__load_progress = (0, 0) # (complete, total)
134
133
                        self.__show_loading_screen(True)
135
134
 
136
135
                        # start our catalogue updates
137
 
                        self.__update_id = gobject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
 
136
                        self.__update_id = GObject.timeout_add_seconds(6 * 60 * 60, self.__update_catalogue)
138
137
                        self.__update_catalogue()
139
138
 
140
139
        def do_impl_can_delete(self):
148
147
 
149
148
        def do_delete_thyself(self):
150
149
                if self.__update_id != 0:
151
 
                        gobject.source_remove(self.__update_id)
 
150
                        GObject.source_remove(self.__update_id)
152
151
                        self.__update_id = 0
153
152
 
154
153
                if self.__notify_id != 0:
155
 
                        gobject.source_remove(self.__notify_id)
 
154
                        GObject.source_remove(self.__notify_id)
156
155
                        self.__notify_id = 0
157
156
 
158
157
                if self.__catalogue_loader is not None:
384
383
                        return False
385
384
 
386
385
                if self.__notify_id == 0:
387
 
                        self.__notify_id = gobject.idle_add(change_idle_cb)
 
386
                        self.__notify_id = GObject.idle_add(change_idle_cb)
388
387
 
389
388
        #
390
389
        # internal purchasing code
548
547
                if entry.get_entry_type() != self.__db.entry_type_get_by_name("MagnatuneEntryType"):
549
548
                        return
550
549
 
551
 
                gobject.idle_add(self.emit_cover_art_uri, entry)
 
550
                GObject.idle_add(self.emit_cover_art_uri, entry)
552
551
 
553
552
        def emit_cover_art_uri(self, entry):
554
553
                sku = self.__sku_dict[self.__db.entry_get_string(entry, RB.RhythmDBPropType.LOCATION)]
556
555
                self.__db.emit_entry_extra_metadata_notify(entry, 'rb:coverArt-uri', url)
557
556
                return False
558
557
 
559
 
gobject.type_register(MagnatuneSource)
 
558
GObject.type_register(MagnatuneSource)