当前位置: 首页>>代码示例>>Python>>正文


Python Playlist.remove_songs方法代码示例

本文整理汇总了Python中quodlibet.util.collection.Playlist.remove_songs方法的典型用法代码示例。如果您正苦于以下问题:Python Playlist.remove_songs方法的具体用法?Python Playlist.remove_songs怎么用?Python Playlist.remove_songs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在quodlibet.util.collection.Playlist的用法示例。


在下文中一共展示了Playlist.remove_songs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_updating_aggregates_remove_songs

# 需要导入模块: from quodlibet.util.collection import Playlist [as 别名]
# 或者: from quodlibet.util.collection.Playlist import remove_songs [as 别名]
    def test_updating_aggregates_remove_songs(s):
        pl = Playlist(s.temp, "playlist")
        pl.extend(NUMERIC_SONGS)
        s.failUnless(pl.get("~#length"))

        pl.remove_songs(NUMERIC_SONGS)
        s.failIf(pl.get("~#length"))
开发者ID:Konzertheld,项目名称:quodlibet,代码行数:9,代码来源:test_util_collection.py

示例2: test_masked_handling

# 需要导入模块: from quodlibet.util.collection import Playlist [as 别名]
# 或者: from quodlibet.util.collection.Playlist import remove_songs [as 别名]
    def test_masked_handling(self):
        if os.name == "nt":
            # FIXME: masking isn't properly implemented on Windows
            return
        # playlists can contain songs and paths for masked handling..
        lib = FileLibrary("foobar")
        pl = Playlist(self.temp, "playlist", lib)
        song = Fakesong({"date": "2038", "~filename": fsnative(u"/fake")})
        song.sanitize()
        lib.add([song])

        # mask and update
        lib.mask("/")
        pl.append(song)
        pl.remove_songs([song])
        self.failUnless("/fake" in pl)

        pl.extend(self.TWO_SONGS)

        # check if collections can handle the mix
        self.failUnlessEqual(pl("date"), "2038")

        # unmask and update
        lib.unmask("/")
        pl.add_songs(["/fake"], lib)
        self.failUnless(song in pl)

        pl.delete()
        lib.destroy()
开发者ID:Konzertheld,项目名称:quodlibet,代码行数:31,代码来源:test_util_collection.py


注:本文中的quodlibet.util.collection.Playlist.remove_songs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。