本文整理汇总了Python中beetsplug.thumbnails.ThumbnailsPlugin.make_dolphin_cover_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:Python ThumbnailsPlugin.make_dolphin_cover_thumbnail方法的具体用法?Python ThumbnailsPlugin.make_dolphin_cover_thumbnail怎么用?Python ThumbnailsPlugin.make_dolphin_cover_thumbnail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beetsplug.thumbnails.ThumbnailsPlugin
的用法示例。
在下文中一共展示了ThumbnailsPlugin.make_dolphin_cover_thumbnail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_dolphin_cover_thumbnail
# 需要导入模块: from beetsplug.thumbnails import ThumbnailsPlugin [as 别名]
# 或者: from beetsplug.thumbnails.ThumbnailsPlugin import make_dolphin_cover_thumbnail [as 别名]
def test_make_dolphin_cover_thumbnail(self, _):
plugin = ThumbnailsPlugin()
tmp = mkdtemp()
album = Mock(path=tmp, artpath=os.path.join(tmp, b"cover.jpg"))
plugin.make_dolphin_cover_thumbnail(album)
with open(os.path.join(tmp, b".directory"), "rb") as f:
self.assertEqual(f.read().splitlines(), [b"[Desktop Entry]", b"Icon=./cover.jpg"])
# not rewritten when it already exists (yup that's a big limitation)
album.artpath = b"/my/awesome/art.tiff"
plugin.make_dolphin_cover_thumbnail(album)
with open(os.path.join(tmp, b".directory"), "rb") as f:
self.assertEqual(f.read().splitlines(), [b"[Desktop Entry]", b"Icon=./cover.jpg"])
rmtree(tmp)