本文整理汇总了Python中kuwo.Net.get_artists方法的典型用法代码示例。如果您正苦于以下问题:Python Net.get_artists方法的具体用法?Python Net.get_artists怎么用?Python Net.get_artists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kuwo.Net
的用法示例。
在下文中一共展示了Net.get_artists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: append_artists
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import get_artists [as 别名]
def append_artists(self, init=False):
if init:
self.artists_liststore.clear()
self.artists_page = 0
self.artists_win.get_vadjustment().set_value(0)
selection = self.cate_treeview.get_selection()
result = selection.get_selected()
if result is None or len(result) != 2:
return
model, _iter = result
pref_index = self.pref_combo.get_active()
catid = model[_iter][1]
prefix = self.pref_liststore[pref_index][1]
# TODO: use async_call()
artists, self.artists_total = Net.get_artists(catid,
self.artists_page, prefix)
if self.artists_total == 0:
return
i = len(self.artists_liststore)
for artist in artists:
self.artists_liststore.append([self.app.theme['anonymous'],
artist['name'], int(artist['id']),
artist['music_num'] + _(' songs'), ])
Net.update_artist_logo(self.artists_liststore, i, 0,
artist['pic'])
i += 1