Пример #1
0
 def on_trackid(self,*args):
     try:
         track = Track.get(self.trackid)
         
         self._container.clear_widgets()
         if track.lyricist:
             self._container.add_widget(ArtBox(category='lyricist',model=track.lyricist,title='شاعر'))
         if track.composer:
             self._container.add_widget(ArtBox(category='composer',model=track.composer,title='آهنگساز'))
         if track.artist:
             self._container.add_widget(ArtBox(category='artist',model=track.artist,title='خواننده'))
     except:
         raise
Пример #2
0
def start():
    
    id = None
    category = None
    mediano = None
    artist = None
    prime = None
    composer = None
    lyricist = None
    dastgah = None
    
    for linetype,line in parse():
        if linetype == LineTypes.CATEGORY:
            category =  Category.ensure(line[0])
        elif linetype == LineTypes.MEDIA_NO:
            mediano = re.match('^CD\s(?P<NO>\d{1,2})\s', line[0]).groups()[0]
        elif linetype == LineTypes.DATA:
            code = line[0]
            prime = line[1]
            title = line[2]
            artist = Artist.ensure(line[3],line[4]) # artist, realname            
            composer = Composer.ensure(line[5])
            lyricist = Lyricist.ensure(line[6])
            dastgah = Genere.ensure(line[7])
            comment = line[8]
            language = line[9]
            
            track = Track.ensure(code, prime,
                           title = title,
                           artist = artist,
                           composer = composer,
                           lyricist = lyricist,
                           genere = dastgah,
                           mediano = mediano,
                           comment = comment,
                           language = language)
            
            print('\t'.join([ str(track.id),
                              code,
                              mediano,
                              prime]))