本文整理匯總了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')