for file in sys.argv[1:]:
    colored_out(bcolors.OKBLUE, "File '%s'" % os.path.basename(file))
    if not os.path.exists(file):
        colored_out(bcolors.FAIL, " * File not found")
        continue
    m = FILE_RE.match(os.path.basename(file))
    if m is None:
        colored_out(bcolors.FAIL,
                    " * File doesn't match defined regular expression")
        continue

    mbid = m.group('mbid')
    type = m.group('type')
    caa_rel_info = CoverArtArchiveReleaseInfo(mbid)
    if caa_rel_info.hasType(type) and type not in ('medium',
                                                   'booklet') and False:
        colored_out(
            bcolors.WARNING,
            " * Release already has an image of type '%s' => skipping" %
            type.lower())
        continue

    colored_out(
        bcolors.OKGREEN,
        " * Adding %s cover art to http://musicbrainz.org/release/%s" %
        (type, mbid))
    time.sleep(10)
    mb.add_cover_art(mbid, file, [type], None, '', '', False)
			images = self.metadata['images']
		else:
			images = []
			for image in self.metadata['images']:
				for img_type in image['types']:
					if img_type == type:
						images.append(image)
						break
		return images

for file in sys.argv[1:]:
	colored_out(bcolors.OKBLUE, "File '%s'" % os.path.basename(file))
	if not os.path.exists(file):
		colored_out(bcolors.FAIL, " * File not found")
		continue
	m = FILE_RE.match(os.path.basename(file))
	if m is None:
		colored_out(bcolors.FAIL, " * File doesn't match defined regular expression")
		continue

	mbid = m.group('mbid')
	type = m.group('type')
	caa_rel_info = CoverArtArchiveReleaseInfo(mbid)
	if caa_rel_info.hasType(type) and type not in ('medium', 'booklet') and False:
		colored_out(bcolors.WARNING, " * Release already has an image of type '%s' => skipping" % type.lower())
		continue

	colored_out(bcolors.OKGREEN, " * Adding %s cover art to http://musicbrainz.org/release/%s" % (type, mbid))
	time.sleep(10)
	mb.add_cover_art(mbid, file, [type], None, '', '', False)