import gnomekeyring as keyring
import xml
import urllib
import urlparse
import threading
import zipfile


magnatune_partner_id = "rhythmbox"

# URIs
magnatune_song_info_uri = gio.File(uri="http://magnatune.com/info/song_info_xml.zip")
magnatune_buy_album_uri = "https://magnatune.com/buy/choose?"
magnatune_api_download_uri = "http://%s:%[email protected]/buy/membership_free_dl_xml?"

magnatune_in_progress_dir = gio.File(path=rb.user_data_dir()).resolve_relative_path('magnatune')
magnatune_cache_dir = gio.File(path=rb.user_cache_dir()).resolve_relative_path('magnatune')

magnatune_song_info = os.path.join(magnatune_cache_dir.get_path(), 'song_info.xml')
magnatune_song_info_temp = os.path.join(magnatune_cache_dir.get_path(), 'song_info.zip.tmp')


class MagnatuneSource(rb.BrowserSource):
	__gproperties__ = {
		'plugin': (rb.Plugin, 'plugin', 'plugin', gobject.PARAM_WRITABLE|gobject.PARAM_CONSTRUCT_ONLY),
	}

	__client = gconf.client_get_default()


	def __init__(self):
Exemple #2
0
	def __init__(self, name):
		self.filename = os.path.join(rb.user_data_dir(), 'mbratings.' + name);
		self.db = anydbm.open(self.filename, 'c')
import xml
import urllib
import urlparse
import threading
import zipfile

magnatune_partner_id = "rhythmbox"

# URIs
magnatune_song_info_uri = gio.File(
    uri="http://magnatune.com/info/song_info_xml.zip")
magnatune_buy_album_uri = "https://magnatune.com/buy/choose?"
magnatune_api_download_uri = "http://%s:%[email protected]/buy/membership_free_dl_xml?"

magnatune_in_progress_dir = gio.File(
    path=rb.user_data_dir()).resolve_relative_path('magnatune')
magnatune_cache_dir = gio.File(
    path=rb.user_cache_dir()).resolve_relative_path('magnatune')

magnatune_song_info = os.path.join(magnatune_cache_dir.get_path(),
                                   'song_info.xml')
magnatune_song_info_temp = os.path.join(magnatune_cache_dir.get_path(),
                                        'song_info.zip.tmp')


class MagnatuneSource(rb.BrowserSource):
    __gproperties__ = {
        'plugin': (rb.Plugin, 'plugin', 'plugin',
                   gobject.PARAM_WRITABLE | gobject.PARAM_CONSTRUCT_ONLY),
    }
has_gnome_keyring = False

#try:
#	import gnomekeyring
#	has_gnome_keyring = True
#except:
#	pass


magnatune_partner_id = "rhythmbox"

# URIs
magnatune_song_info_uri = "http://magnatune.com/info/song_info_xml.zip"

magnatune_in_progress_dir = os.path.join(rb.user_data_dir(), 'magnatune')
magnatune_cache_dir = os.path.join(rb.user_cache_dir(), 'magnatune')

magnatune_song_info = os.path.join(magnatune_cache_dir, 'song_info.xml')
magnatune_song_info_temp = os.path.join(magnatune_cache_dir, 'song_info.zip.tmp')


ALBUM_ART_URL = 'http://www.magnatune.com/music/%s/%s/cover.jpg'

class MagnatuneSource(rb.BrowserSource):
	__gproperties__ = {
		'plugin': (rb.Plugin, 'plugin', 'plugin', gobject.PARAM_WRITABLE|gobject.PARAM_CONSTRUCT_ONLY),
	}

	__client = gconf.client_get_default()