Ejemplo n.º 1
0
def main():
    args = argHandler()
    if args.recursively is None:
        if (args.file is None):
            print "Error: Must especified at least one argument: -f (file)" \
                  + " or -r (folder)"
        else:
            if (checkPath(args.file, 'File')):
                if (isMP3(args.file)):
                    tag = Tag()
                    tag.create(args.file)
                    updateTag(tag, args)
                    tag.updateFile()
                else:
                    print "Error: is not mp3 file"
    else:
        if (checkPath(args.recursively, 'Folder')):
            for root, dirs, files in os.walk(args.recursively, topdown=False):
                for file in files:
                    if (isMP3(file)):
                        tag = Tag()
                        tag.create(os.path.join(root, file))
                        updateTag(tag, args)
                        tag.updateFile()
    print "Done!"
Ejemplo n.º 2
0
def updateFolder(folder, args):
    for root, dirs, files in os.walk(folder, topdown=False):
        for file in files:
            if (isMP3(file)):
                tag = Tag()
                tag.create(os.path.join(root, file))
                updateTag(tag, args)
                tag.updateFile()