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


Python Net.get_themes_main方法代码示例

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


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

示例1: first

# 需要导入模块: from kuwo import Net [as 别名]
# 或者: from kuwo.Net import get_themes_main [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'])
开发者ID:lifuljk,项目名称:kwplayer,代码行数:73,代码来源:Themes.py


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