Exemplo n.º 1
0
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#mtp-lastfm is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with mtp-lastfm.  If not, see http://www.gnu.org/licenses/

import os
import time

import localisation
_ = localisation.set_get_text()

class SongData(object):
    
    def __init__(self, db, path, parent):
        self.db = db
        self.parent = parent
        self.ready_for_export = False
        self.required_data = {'Track ID:' : False, 'Title:' : False,
                              'Artist:' : False, 'Album:' : False,
                              'Track number:' : False, 'Duration:' : False,
                              'User rating:' : False, 'Use count:' :False}
        self.integer_types = ('Track ID:', 'Use count:',
                         'Duration:', 'User rating:')
        #for localisation we will have a separate list of required data
        #as it is used in other areas of the program
Exemplo n.º 2
0
#mtp-lastfm is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with mtp-lastfm.  If not, see http://www.gnu.org/licenses/

import gtk
import pygtk
import gobject

import webservices
import localisation

_ = localisation.set_get_text()

class LastfmTagger(object):
    
    def __init__(self, parent, artist, track, album):
        self.info = {"Track" : track,"Artist" : artist, "Album" : album }
        self.trans_info = { _("Track") : "Track", _("Artist") : "Artist",
                           _("Album") : "Album"}
        self.username = parent.username
        self.sk = parent.session_key
        self.wTree = gtk.glade.XML(parent.GLADE['tag'])
        self.fill_combo_box()
        self.prepare_treeview("popular_treeview")
        self.prepare_treeview("your_treeview")
        self.buffer = self.wTree.get_widget("tags").get_buffer()
        self.buffer.connect("changed", self.sanitise_tags)