本文整理汇总了Python中lollypop.selectionlist.SelectionList.get_pl_headers方法的典型用法代码示例。如果您正苦于以下问题:Python SelectionList.get_pl_headers方法的具体用法?Python SelectionList.get_pl_headers怎么用?Python SelectionList.get_pl_headers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lollypop.selectionlist.SelectionList
的用法示例。
在下文中一共展示了SelectionList.get_pl_headers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lollypop.selectionlist import SelectionList [as 别名]
# 或者: from lollypop.selectionlist.SelectionList import get_pl_headers [as 别名]
#.........这里部分代码省略.........
if selection_list == self.__list_one:
if self.__list_two.is_visible():
self.__list_two.hide()
self.__list_two_restore = Type.NONE
loader = Loader(target=load, view=selection_list,
on_finished=lambda r: setup(*r))
loader.start()
def __update_list_charts(self):
"""
Setup list for charts
@thread safe
"""
def load():
genres = Lp().genres.get_charts()
return genres
def setup(genres):
genres.insert(0, (Type.SEPARATOR, ''))
genres.insert(0, (Type.ITUNES, 'Itunes'))
genres.insert(0, (Type.LASTFM, 'Last.fm'))
genres.insert(0, (Type.SPOTIFY, "Spotify"))
self.__list_two.populate(genres)
self.__list_two.mark_as_artists(False)
loader = Loader(target=load, view=self.__list_two, on_finished=setup)
loader.start()
def __update_list_playlists(self, update):
"""
Setup list for playlists
@param update as bool
@thread safe
"""
items = self.__list_two.get_pl_headers()
items += Lp().playlists.get()
if update:
self.__list_two.update_values(items)
else:
self.__list_two.mark_as_artists(False)
self.__list_two.populate(items)
def __stop_current_view(self):
"""
Stop current view
"""
child = self.__stack.get_visible_child()
if child is not None:
if hasattr(child, "stop"):
child.stop()
def __update_view_device(self, device_id):
"""
Update current view with device view,
Use existing view if available
@param device id as int
"""
from lollypop.view_device import DeviceView, DeviceLocked
self.__stop_current_view()
device = self.__devices[device_id]
child = self.__stack.get_child_by_name(device.uri)
if child is None:
files = DeviceView.get_files(device.uri)
if files:
if child is None:
child = DeviceView(device)
self.__stack.add_named(child, device.uri)