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


Python SavedPlaylist.remove_item方法代码示例

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


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

示例1: test_callbacks

# 需要导入模块: from miro.playlist import SavedPlaylist [as 别名]
# 或者: from miro.playlist.SavedPlaylist import remove_item [as 别名]
 def test_callbacks(self):
     initialList = [self.i1, self.i2, self.i3]
     playlist = SavedPlaylist(u"rocketboom", [i.id for i in initialList])
     tracker = Item.playlist_view(playlist.id).make_tracker()
     tracker.connect('added', self.add_callback)
     tracker.connect('removed', self.remove_callback)
     playlist.add_item(self.i4)
     self.check_callbacks([self.i4], [])
     playlist.remove_item(self.i3)
     self.check_callbacks([self.i4], [self.i3])
开发者ID:cool-RR,项目名称:Miro,代码行数:12,代码来源:playlisttest.py

示例2: PlaylistFolderTestCase

# 需要导入模块: from miro.playlist import SavedPlaylist [as 别名]
# 或者: from miro.playlist.SavedPlaylist import remove_item [as 别名]
class PlaylistFolderTestCase(PlaylistTestBase):
    def setUp(self):
        PlaylistTestBase.setUp(self)
        self.playlistTabOrder = tabs.TabOrder(u'playlist')
        self.p1 = SavedPlaylist(u"rocketboom", [self.i1.id, self.i3.id])
        self.p2 = SavedPlaylist(u"telemusicvision", [self.i4.id, self.i3.id])
        self.p3 = SavedPlaylist(u"digg", [self.i1.id, self.i2.id,
                                          self.i3.id, self.i4.id])
        self.folder = PlaylistFolder(u"My Best Vids")
        self.p1.set_folder(self.folder)
        self.p2.set_folder(self.folder)
        self.p3.set_folder(self.folder)

    def check_list(self, correct_order):
        correct_ids = [item.id for item in correct_order]
        actual_ids = list(i.id for i in
                Item.playlist_folder_view(self.folder.id))
        self.assertEquals(actual_ids, correct_ids)

    def test_add_playlists(self):
        self.check_list([self.i1, self.i3, self.i4, self.i2])

    def test_change_folder(self):
        self.p3.set_folder(None)
        self.check_list([self.i1, self.i3, self.i4])
        self.p2.set_folder(None)
        self.check_list([self.i1, self.i3])
        self.p1.set_folder(None)
        self.check_list([])

    def test_remove_playlist(self):
        self.p3.remove()
        self.check_list([self.i1, self.i3, self.i4])
        self.p2.remove()
        self.check_list([self.i1, self.i3])
        self.p1.remove()
        self.check_list([])

    def test_remove_items_from_playlist(self):
        self.p3.remove_item(self.i2)
        self.check_list([self.i1, self.i3, self.i4])
        self.p3.remove_item(self.i3)
        # i3 is still in other children of self.folder, so it
        # shouldn't be removed
        self.check_list([self.i1, self.i3, self.i4])

    def test_order_independent(self):
        self.p3.reorder([self.i4.id, self.i2.id, self.i3.id, self.i1.id])
        self.check_list([self.i1, self.i3, self.i4, self.i2])
        self.folder.reorder([self.i4.id, self.i3.id, self.i2.id, self.i1.id])
        self.check_list([self.i4, self.i3, self.i2, self.i1])

    def test_remove_folder_removes_playlist(self):
        self.folder.remove()
        self.assertEquals(SavedPlaylist.make_view().count(), 0)
开发者ID:cool-RR,项目名称:Miro,代码行数:57,代码来源:playlisttest.py

示例3: test_basic_operations

# 需要导入模块: from miro.playlist import SavedPlaylist [as 别名]
# 或者: from miro.playlist.SavedPlaylist import remove_item [as 别名]
 def test_basic_operations(self):
     playlist = SavedPlaylist(u"rocketboom")
     self.assertEquals(playlist.get_title(), u'rocketboom')
     self.check_list(playlist, [])
     playlist.add_item(self.i4)
     playlist.add_item(self.i1)
     playlist.add_item(self.i3)
     playlist.add_item(self.i2)
     self.check_list(playlist, [self.i4, self.i1, self.i3, self.i2])
     playlist.add_item(self.i2)
     self.check_list(playlist, [self.i4, self.i1, self.i3, self.i2])
     self.assert_(self.i1.keep)
     self.assert_(self.i2.keep)
     self.assert_(self.i3.keep)
     self.assert_(self.i4.keep)
     playlist.remove_item(self.i2)
     self.check_list(playlist, [self.i4, self.i1, self.i3])
     playlist.reorder([self.i3.id, self.i4.id, self.i1.id])
     self.check_list(playlist, [self.i3, self.i4, self.i1])
     playlist.remove_item(self.i3)
     self.check_list(playlist, [self.i4, self.i1])
开发者ID:cool-RR,项目名称:Miro,代码行数:23,代码来源:playlisttest.py


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