當前位置: 首頁>>代碼示例>>Python>>正文


Python plugins.BeetsPlugin類代碼示例

本文整理匯總了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')
開發者ID:Cornellio,項目名稱:beets,代碼行數:12,代碼來源:test_mediafile.py

示例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')
開發者ID:geigerzaehler,項目名稱:beets,代碼行數:12,代碼來源:test_mediafile.py

示例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')
開發者ID:geigerzaehler,項目名稱:beets,代碼行數:12,代碼來源:test_mediafile.py

示例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')
開發者ID:Cornellio,項目名稱:beets,代碼行數:13,代碼來源:test_mediafile.py

示例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')
開發者ID:Cornellio,項目名稱:beets,代碼行數:14,代碼來源:test_mediafile.py

示例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')
開發者ID:geigerzaehler,項目名稱:beets,代碼行數:14,代碼來源:test_mediafile.py


注:本文中的beets.plugins.BeetsPlugin類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。