Пример #1
0
    def test_removeTagResults(self):
        releaseAllClones(g_clonenames)
        f_value = "funny"
        f_expected = [
            "stock photo", "bad stock photos of my job", "technology"
        ]
        f_filename = singleClone(g_files["fixingComputer.jpg"].fullname)
        MetadataManagerL1.removeTag(f_filename, f_value)
        self.assertEqual(f_expected, MetadataManagerL0.getTags(f_filename))
        os.remove(f_filename)

        f_value = "cat"
        f_expected = []
        f_filename = singleClone(g_files["catScreamPizza.jpg"].fullname)
        MetadataManagerL1.removeTag(f_filename, f_value)
        self.assertEqual(f_expected, MetadataManagerL0.getTags(f_filename))
        os.remove(f_filename)
Пример #2
0
def removeTag(p_filename, p_tag):
    """
    :param p_filename: name/path of the file
	:type p_filename: string
	:param p_tag: tag you will be removing from the tag metadata
	:type p_tag: string

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