Пример #1
0
    def test_removeArtistResults(self):
        releaseAllClones(g_clonenames)
        f_value = "publisher: twitter"
        f_expected = ["stockphotographer"]
        f_filename = singleClone(g_files["fixingComputer.jpg"].fullname)
        MetadataManagerL1.removeArtist(f_filename, f_value)
        self.assertEqual(f_expected, MetadataManagerL0.getArtists(f_filename))
        os.remove(f_filename)

        f_value = "photographer: idunno"
        f_expected = []
        f_filename = singleClone(g_files["catScreamPizza.jpg"].fullname)
        MetadataManagerL1.removeArtist(f_filename, f_value)
        self.assertEqual(f_expected, MetadataManagerL0.getArtists(f_filename))
        os.remove(f_filename)
Пример #2
0
def removeArtist(p_filename, p_artist):
    """
    removes artist from artist metadata

    :param p_filename: name/path of the file
	:type p_filename: string
	:param p_artist: artist we are removing from the artist metadata
	:type p_artist: string

	:return: True if operation was successful
    :rtype: bool
    """
    try:
        MetadataManagerL1.removeArtist(p_filename, p_artist)
    except Exception as e:
        print("MetadataManager2.removeArtist() error: ", e)
        return False
    try:
        MetadataManagerL1.placeMark(p_filename)
        return True
    except Exception as e:
        print("MetadataManager2.removeArtist() Mark error: ", e)
        return True