예제 #1
0
    def editor(shown):
        options = ['s', 'x', 'u', 'p']
        while shown:
            wish = m.editorMenu()
            if wish == 'a':
                info = m.addAlbum()
                aa.addAlbum(info[0], info[1], info[2], info[3])
                for a in range(0, len(info[4])):
                    aa.addAlbumArtista(info[0], info[1], info[4][a])
                for o in range(0, len(info[5])):
                    aa.addAlbumMusica(o + 1, info[0], info[1], info[5][o])
            elif wish == 'up':
                info = m.selectUser()
                if info == 'v':
                    print('operacao cancelada')
                else:
                    us.setAdmin(info)
            elif wish == 'm':
                info = m.addMusic()
                idM = mm.addMusic(info[0], info[1], info[2], info[3])
                if idM is not None:
                    for a in range(0, len(info[5])):
                        mm.addMusicArtista(idM, info[4][a], info[5][a])
                    for o in range(0, len(info[6])):
                        mm.addAMusicGenre(idM, info[6][o])
            elif wish == 'c':
                info = m.addConcert()
                idC = cc.addConcert(info[0], info[1], info[2])
                if idC is not None:
                    for a in range(0, len(info[3])):
                        cc.addConcertArtista(a + 1, idC, info[3][a])
                    for o in range(0, len(info[4])):
                        cc.addConcertMusic(o + 1, idC, info[4][o])

            elif wish == 'ar':
                arType = m.askType()
                info = m.addArtist()
                idAr = ar.addArtist(info[0], info[1])
                if idAr is not None:
                    if arType == 'b':
                        band = m.addBand()
                        ar.addBand(band, band[2], idAr)

                        for a in range(0, len(band[3])):
                            ar.addBandArtista(band[4][a], band[5][a],
                                              band[6][a], idAr, band[3][a])
                    elif arType == 'a':
                        artist = m.addArt()
                        ar.addMusico(artist[0], artist[1], artist[2], idAr)
            elif wish == 'g':
                gen = m.askGenero()
                ge.addGenero(gen)
            if wish == 'v':
                shown = False
                break
            if wish in options:
                return wish
                break
예제 #2
0
    def artista(shown, idAr, editor, user):
        options = ['s', 'x', 'u', 'p']

        while shown:
            ar.showDetailsArtist(idAr)
            banda = ar.getType(idAr)
            if banda:
                print('banda=')

                choice = m.showingBanda(idAr)

                if choice == 'm':
                    ar.listMembers(idAr)
                    print('members only')
##
            else:
                ar.detailMusico(idAr)
                choice = m.showingMusico()

            if choice == 'v':
                shown = False
                break
            if choice in options:
                return wish
                break
            if editor and choice == 'e':
                edit = True
                while edit:
                    change = m.alterArtist(banda)
                    if change == 'aa':
                        papel, dataE, dataS, art = m.addArtistToBand()
                        ar.addBandArtista(papel, dataE, dataS, idAr, art)  ##
                    if change == 'ra':
                        art = m.askId()
                        ar.removeArtist(idAr, art)

                    if change == 'n' or change == 'b':
                        dics = {'n': 'nome', 'b': 'biografia'}
                        new = m.setValue()
                        ar.alterArtistDetails(dics[change], new, idAr)
                    if change == 'l' or change == 'id' or change == 'fd':  ###
                        dics = {
                            'l': 'localformacao',
                            'id': 'dataformacao',
                            'fd': 'datafim'
                        }
                        new = m.setValue()
                        ar.alterBandDetails(dics[change], new, idAr)
                    if change == 'nd' or change == 'ln' or change == 'od':  ###
                        dics = {
                            'nd': 'data_nascimento',
                            'ln': 'local_nascimento',
                            'od': 'data_obito'
                        }
                        new = m.setValue()
                        ar.alterMusicoDetails(dics[change], new, idAr)
                    if change == 'v':
                        break
                    if change in options:
                        return change
                        break