本文整理汇总了Python中kuwo.Net.get_index_nodes方法的典型用法代码示例。如果您正苦于以下问题:Python Net.get_index_nodes方法的具体用法?Python Net.get_index_nodes怎么用?Python Net.get_index_nodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kuwo.Net
的用法示例。
在下文中一共展示了Net.get_index_nodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: first
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import get_index_nodes [as 别名]
def first(self):
if self.first_show:
return
self.first_show = True
app = self.app
self.buttonbox = Gtk.Box(spacing=5)
self.pack_start(self.buttonbox, False, False, 0)
button_home = Gtk.Button(_('MV'))
button_home.connect('clicked', self.on_button_home_clicked)
self.buttonbox.pack_start(button_home, False, False, 0)
self.label = Gtk.Label('')
self.buttonbox.pack_start(self.label, False, False, 0)
# pic, name, artist, album, rid, artistid, albumid, tooltip
self.liststore_songs = Gtk.ListStore(GdkPixbuf.Pixbuf,
str, str, str, int, int, int, str)
self.mv_control_box = Widgets.MVControlBox(self.liststore_songs,
self.app)
self.buttonbox.pack_end(self.mv_control_box, False, False, 0)
self.scrolled_nodes = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_nodes, True, True, 0)
# logo, name, nid, info, tooltip
self.liststore_nodes = Gtk.ListStore(GdkPixbuf.Pixbuf,
str, int, str, str)
iconview_nodes = Widgets.IconView(self.liststore_nodes, tooltip=4)
iconview_nodes.connect('item_activated',
self.on_iconview_nodes_item_activated)
self.scrolled_nodes.add(iconview_nodes)
self.scrolled_songs = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_songs, True, True, 0)
iconview_songs = Widgets.IconView(self.liststore_songs,
info_pos=2, tooltip=7)
iconview_songs.connect('item_activated',
self.on_iconview_songs_item_activated)
self.scrolled_songs.add(iconview_songs)
self.show_all()
self.buttonbox.hide()
self.scrolled_songs.hide()
nid = 3
nodes_wrap = Net.get_index_nodes(nid)
if not nodes_wrap:
return
nodes = nodes_wrap['child']
self.liststore_nodes.clear()
i = 0
for node in nodes:
self.liststore_nodes.append([
self.app.theme['anonymous'],
Widgets.unescape_html(node['disname']),
int(node['sourceid']),
Widgets.unescape_html(node['info']),
Widgets.set_tooltip(node['disname'], node['info']),
])
Net.update_liststore_image(self.liststore_nodes, i, 0,
node['pic'])
i += 1