本文整理汇总了Python中mutagen.flac.FLAC.get_primary_image方法的典型用法代码示例。如果您正苦于以下问题:Python FLAC.get_primary_image方法的具体用法?Python FLAC.get_primary_image怎么用?Python FLAC.get_primary_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutagen.flac.FLAC
的用法示例。
在下文中一共展示了FLAC.get_primary_image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_clear_images
# 需要导入模块: from mutagen.flac import FLAC [as 别名]
# 或者: from mutagen.flac.FLAC import get_primary_image [as 别名]
def test_clear_images(self):
data = "abc"
song = FLAC(self.filename)
pic = Picture()
pic.data = data
song.add_picture(pic)
song.save()
song = FLACFile(self.filename)
self.assertTrue(song.get_primary_image())
song.clear_images()
song.clear_images()
song = FLACFile(self.filename)
self.assertFalse(song.get_primary_image())
示例2: test_get_image
# 需要导入模块: from mutagen.flac import FLAC [as 别名]
# 或者: from mutagen.flac.FLAC import get_primary_image [as 别名]
def test_get_image(self):
data = "abc"
song = FLAC(self.filename)
pic = Picture()
pic.data = data
song.add_picture(pic)
song.save()
song = FLACFile(self.filename)
self.failUnless(song("~picture"))
fn = song.get_primary_image().file
self.failUnlessEqual(fn.read(), pic.data)