本文整理汇总了Python中beets.plugins.BeetsPlugin类的典型用法代码示例。如果您正苦于以下问题:Python BeetsPlugin类的具体用法?Python BeetsPlugin怎么用?Python BeetsPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BeetsPlugin类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extended_field_write
def test_extended_field_write(self):
plugin = BeetsPlugin()
plugin.add_media_field('customtag', field_extension)
mediafile = self._mediafile_fixture('empty')
mediafile.customtag = u'F#'
mediafile.save()
mediafile = MediaFile(mediafile.path)
self.assertEqual(mediafile.customtag, u'F#')
delattr(MediaFile, 'customtag')
Item._media_fields.remove('customtag')
示例2: test_read_flexible_attribute_from_file
def test_read_flexible_attribute_from_file(self):
plugin = BeetsPlugin()
plugin.add_media_field('initialkey', field_extension)
mediafile = self._mediafile_fixture('empty')
mediafile.update({'initialkey': 'F#'})
item = Item.from_path(mediafile.path)
self.assertEqual(item['initialkey'], 'F#')
delattr(MediaFile, 'initialkey')
Item.media_fields.remove('initialkey')
示例3: test_extended_field_write
def test_extended_field_write(self):
plugin = BeetsPlugin()
plugin.add_media_field('initialkey', field_extension)
mediafile = self._mediafile_fixture('empty')
mediafile.initialkey = 'F#'
mediafile.save()
mediafile = MediaFile(mediafile.path)
self.assertEqual(mediafile.initialkey, 'F#')
delattr(MediaFile, 'initialkey')
Item.media_fields.remove('initialkey')
示例4: test_read_flexible_attribute_from_file
def test_read_flexible_attribute_from_file(self):
plugin = BeetsPlugin()
plugin.add_media_field('customtag', field_extension)
mediafile = self._mediafile_fixture('empty')
mediafile.update({'customtag': u'F#'})
mediafile.save()
item = Item.from_path(mediafile.path)
self.assertEqual(item['customtag'], u'F#')
delattr(MediaFile, 'customtag')
Item._media_fields.remove('customtag')
示例5: test_write_extended_tag_from_item
def test_write_extended_tag_from_item(self):
plugin = BeetsPlugin()
plugin.add_media_field('customtag', field_extension)
mediafile = self._mediafile_fixture('empty')
self.assertIsNone(mediafile.customtag)
item = Item(path=mediafile.path, customtag=u'Gb')
item.write()
mediafile = MediaFile(mediafile.path)
self.assertEqual(mediafile.customtag, u'Gb')
delattr(MediaFile, 'customtag')
Item._media_fields.remove('customtag')
示例6: test_write_extended_tag_from_item
def test_write_extended_tag_from_item(self):
plugin = BeetsPlugin()
plugin.add_media_field('initialkey', field_extension)
mediafile = self._mediafile_fixture('empty')
self.assertEqual(mediafile.initialkey, '')
item = Item(path=mediafile.path, initialkey='Gb')
item.write()
mediafile = MediaFile(mediafile.path)
self.assertEqual(mediafile.initialkey, 'Gb')
delattr(MediaFile, 'initialkey')
Item.media_fields.remove('initialkey')