本文整理汇总了Python中kuwo.Net.update_liststore_image方法的典型用法代码示例。如果您正苦于以下问题:Python Net.update_liststore_image方法的具体用法?Python Net.update_liststore_image怎么用?Python Net.update_liststore_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kuwo.Net
的用法示例。
在下文中一共展示了Net.update_liststore_image方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: first
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [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
示例2: show_sub
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def show_sub(self, init=False):
if init:
self.scrolled_main.hide()
self.scrolled_songs.hide()
self.buttonbox.show_all()
self.button_sub.hide()
self.control_box.hide()
self.scrolled_sub.get_vadjustment().set_value(0)
self.scrolled_sub.show_all()
self.nodes_page = 0
self.liststore_sub.clear()
nodes, self.nodes_total = Net.get_nodes(
self.curr_sub_id, self.nodes_page)
if not nodes:
return
for i, node in enumerate(nodes):
self.liststore_sub.append([
self.app.theme['anonymous'],
Widgets.unescape(node['name']),
int(node['sourceid']),
Widgets.unescape(node['info']),
Widgets.set_tooltip_with_song_tips(
node['name'], node['tips']),
])
Net.update_liststore_image(
self.liststore_sub, i, 0, node['pic'])
示例3: _show_sub1
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def _show_sub1(sub1_args, error=None):
nodes, self.sub1_total = sub1_args
if not nodes or self.sub1_total == 0:
return
for i, node in enumerate(nodes):
_id = 'id' if self.use_sub2 else 'sourceid'
if 'tips' in node and len(node['tips']) > 5:
_tooltip = Widgets.set_tooltip_with_song_tips(
node['name'], node['tips'])
else:
_tooltip = Widgets.set_tooltip(
node['name'], node['info'])
self.liststore_sub1.append([
self.app.theme['anonymous'],
Widgets.unescape(node['name']),
int(node[_id]),
Widgets.unescape(node['info']),
_tooltip,
])
Net.update_liststore_image(
self.liststore_sub1, i, 0, node['pic'])
self.sub1_page += 1
if self.sub1_page < self.sub1_total - 1:
self.show_sub1()
示例4: first
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def first(self):
if self.first_show:
return
self.first_show = True
app = self.app
# left side panel
scrolled_myradio = Gtk.ScrolledWindow()
scrolled_myradio.props.hscrollbar_policy = Gtk.PolicyType.NEVER
self.pack_start(scrolled_myradio, False, False, 0)
# radios selected by user.
self.box_myradio = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.box_myradio.props.margin_left = 10
scrolled_myradio.add(self.box_myradio)
self.scrolled_radios = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_radios, True, True, 0)
# pic, name, id, num of listeners, pic_url, tooltip
self.liststore_radios = Gtk.ListStore(GdkPixbuf.Pixbuf,
str, int, str, str, str)
iconview_radios = Widgets.IconView(self.liststore_radios, tooltip=5)
iconview_radios.connect('item_activated',
self.on_iconview_radios_item_activated)
self.scrolled_radios.add(iconview_radios)
self.show_all()
nid = 8
page = 0
radios, total_page = Net.get_nodes(nid, page)
if total_page == 0:
return
i = 0
for radio in radios:
self.liststore_radios.append([
self.app.theme['anonymous'],
Widgets.unescape_html(radio['disname']),
int(radio['sourceid'].split(',')[0]),
Widgets.unescape_html(radio['info']),
radio['pic'],
Widgets.set_tooltip(radio['disname'], radio['info']),
])
Net.update_liststore_image(self.liststore_radios, i, 0,
radio['pic']),
i += 1
for radio in self.playlists:
radio_item = RadioItem(radio, self.app)
self.box_myradio.pack_start(radio_item, False, False, 0)
GLib.timeout_add(300000, self.dump_playlists)
示例5: _show_sub2
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def _show_sub2(sub2_args, error=None):
nodes, self.sub2_total = sub2_args
if node is None or self.sub2_total == 0:
return
i = len(self.liststore_sub2)
for node in nodes:
self.liststore_sub2.append([self.app.theme['anonymous'],
node['name'], int(node['sourceid']), node['info'], ])
Net.update_liststore_image(self.liststore_sub2, i, 0,
node['pic'])
i += 1
self.sub2_page += 1
if self.sub2_page < self.sub2_total - 1:
self.show_sub2()
示例6: _show_sub1
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def _show_sub1(sub1_args, error=None):
nodes, self.sub1_total = sub1_args
if nodes is None or self.sub1_total == 0:
return
i = len(self.liststore_sub1)
for node in nodes:
_id = 'id' if self.use_sub2 else 'sourceid'
self.liststore_sub1.append([self.app.theme['anonymous'],
node['name'], int(node[_id]), node['info'], ])
Net.update_liststore_image(self.liststore_sub1, i, 0,
node['pic'])
i += 1
self.sub1_page += 1
if self.sub1_page < self.sub1_total - 1:
self.show_sub1()
示例7: _show_sub2
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def _show_sub2(sub2_args, error=None):
nodes, self.sub2_total = sub2_args
if not nodes or self.sub2_total == 0:
return
for i, node in enumerate(nodes):
self.liststore_sub2.append([
self.app.theme['anonymous'],
Widgets.unescape(node['name']),
int(node['sourceid']),
Widgets.unescape(node['info']),
Widgets.set_tooltip_with_song_tips(
node['name'], node['tips']),
])
Net.update_liststore_image(
self.liststore_sub2, i, 0, node['pic'])
self.sub2_page += 1
if self.sub2_page < self.sub2_total - 1:
self.show_sub2()
示例8: show_sub
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def show_sub(self, init=False):
if init:
self.scrolled_main.hide()
self.scrolled_songs.hide()
self.buttonbox.show_all()
self.button_sub.hide()
self.control_box.hide()
self.scrolled_sub.get_vadjustment().set_value(0)
self.scrolled_sub.show_all()
self.nodes_page = 0
self.liststore_sub.clear()
nodes, self.nodes_total = Net.get_nodes(self.curr_sub_id,
self.nodes_page)
if nodes is None:
return
i = len(self.liststore_sub)
for node in nodes:
self.liststore_sub.append([self.app.theme['anonymous'],
node['name'], int(node['sourceid']), node['info'], ])
Net.update_liststore_image(self.liststore_sub, i, 0,
node['pic'])
i += 1
示例9: first
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def first(self):
app = self.app
self.buttonbox = Gtk.Box(spacing=5)
self.pack_start(self.buttonbox, False, False, 0)
self.button_main = Gtk.Button(_('Themes'))
self.button_main.connect('clicked', self.on_button_main_clicked)
self.buttonbox.pack_start(self.button_main, False, False, 0)
self.button_sub = Gtk.Button('')
self.button_sub.connect('clicked', self.on_button_sub_clicked)
self.buttonbox.pack_start(self.button_sub, False, False, 0)
self.label = Gtk.Label('')
self.buttonbox.pack_start(self.label, False, False, 0)
# checked, name, artist, album, rid, artistid, albumid
self.liststore_songs = Gtk.ListStore(
bool, str, str, str, int, int, int)
self.control_box = Widgets.ControlBox(self.liststore_songs, app)
self.buttonbox.pack_end(self.control_box, False, False, 0)
self.scrolled_main = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_main, True, True, 0)
# pic, name, id, info(num of lists), tooltip
self.liststore_main = Gtk.ListStore(
GdkPixbuf.Pixbuf, str, int, str, str)
iconview_main = Widgets.IconView(self.liststore_main, tooltip=4)
iconview_main.connect(
'item_activated', self.on_iconview_main_item_activated)
self.scrolled_main.add(iconview_main)
self.scrolled_sub = Gtk.ScrolledWindow()
self.scrolled_sub.get_vadjustment().connect(
'value-changed', self.on_scrolled_sub_scrolled)
self.pack_start(self.scrolled_sub, True, True, 0)
# pic, name, sourceid, info(num of lists), tooltip
self.liststore_sub = Gtk.ListStore(
GdkPixbuf.Pixbuf, str, int, str, str)
iconview_sub = Widgets.IconView(self.liststore_sub, tooltip=4)
iconview_sub.connect(
'item_activated', self.on_iconview_sub_item_activated)
self.scrolled_sub.add(iconview_sub)
self.scrolled_songs = Gtk.ScrolledWindow()
self.scrolled_songs.get_vadjustment().connect(
'value-changed', self.on_scrolled_songs_scrolled)
self.pack_start(self.scrolled_songs, True, True, 0)
treeview_songs = Widgets.TreeViewSongs(self.liststore_songs, app)
self.scrolled_songs.add(treeview_songs)
self.show_all()
self.buttonbox.hide()
self.scrolled_sub.hide()
self.scrolled_songs.hide()
nodes = Net.get_themes_main()
if not nodes:
print('Failed to get nodes, do something!')
return
for i, node in enumerate(nodes):
self.liststore_main.append([
self.app.theme['anonymous'],
Widgets.unescape(node['name']),
int(node['nid']),
Widgets.unescape(node['info']),
Widgets.set_tooltip(node['name'], node['info']),
])
Net.update_liststore_image(
self.liststore_main, i, 0, node['pic'])
示例10: first
# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import update_liststore_image [as 别名]
def first(self):
if self.first_show:
return
self.first_show = True
app = self.app
self.buttonbox = Gtk.Box()
self.pack_start(self.buttonbox, False, False, 0)
self.button_main = Gtk.Button(_('Top Categories'))
self.button_main.connect('clicked', self.on_button_main_clicked)
self.buttonbox.pack_start(self.button_main, False, False, 0)
self.button_sub1 = Gtk.Button('')
self.button_sub1.connect('clicked', self.on_button_sub1_clicked)
self.buttonbox.pack_start(self.button_sub1, False, False, 0)
self.button_sub2 = Gtk.Button('')
self.button_sub2.connect('clicked', self.on_button_sub2_clicked)
self.buttonbox.pack_start(self.button_sub2, False, False, 0)
self.label = Gtk.Label('')
self.buttonbox.pack_start(self.label, False, False, 0)
# checked, name, artist, album, rid, artistid, albumid
self.liststore_songs = Gtk.ListStore(bool, str, str, str,
int, int, int)
self.control_box = Widgets.ControlBox(self.liststore_songs, app)
self.buttonbox.pack_end(self.control_box, False, False, 0)
self.scrolled_main = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_main, True, True, 0)
# logo, name, nid, num of lists(info)
self.liststore_main = Gtk.ListStore(GdkPixbuf.Pixbuf, str, int, str)
iconview_main = Widgets.IconView(self.liststore_main)
iconview_main.connect('item_activated',
self.on_iconview_main_item_activated)
self.scrolled_main.add(iconview_main)
self.scrolled_sub1 = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_sub1, True, True, 0)
# logo, name, nid, num of lists(info)
self.liststore_sub1 = Gtk.ListStore(GdkPixbuf.Pixbuf, str, int, str)
iconview_sub1 = Widgets.IconView(self.liststore_sub1, tooltip=1)
iconview_sub1.connect('item_activated',
self.on_iconview_sub1_item_activated)
self.scrolled_sub1.add(iconview_sub1)
self.scrolled_sub2 = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_sub2, True, True, 0)
# logo, name, nid, info
self.liststore_sub2 = Gtk.ListStore(GdkPixbuf.Pixbuf, str, int, str)
iconview_sub2 = Widgets.IconView(self.liststore_sub2, tooltip=1)
iconview_sub2.connect('item_activated',
self.on_iconview_sub2_item_activated)
self.scrolled_sub2.add(iconview_sub2)
self.scrolled_songs = Gtk.ScrolledWindow()
self.pack_start(self.scrolled_songs, True, True, 0)
treeview_songs = Widgets.TreeViewSongs(self.liststore_songs, app)
self.scrolled_songs.add(treeview_songs)
self.show_all()
self.buttonbox.hide()
self.scrolled_sub1.hide()
self.scrolled_sub2.hide()
self.scrolled_songs.hide()
nid = 5
page = 0
nodes, total_page = Net.get_nodes(nid, page)
if nodes is None:
print('Failed to get nodes, do something!')
return
i = 0
for node in nodes:
self.liststore_main.append([self.app.theme['anonymous'],
Widgets.unescape_html(node['disname']),
int(node['id']),
Widgets.unescape_html(node['info']), ])
Net.update_liststore_image(self.liststore_main, i, 0,
node['pic'])
i += 1