appview.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:x-mario-center 作者: fossasia 项目源码 文件源码
def on_entry_changed(widget, data):

    def _work():
        new_text = widget.get_text()
        (view, enquirer) = data

        with ExecutionTime("total time"):
            with ExecutionTime("enquire.set_query()"):
                enquirer.set_query(get_query_from_search_entry(new_text),
                    limit=100 * 1000,
                    nonapps_visible=NonAppVisibility.ALWAYS_VISIBLE)

            store = view.tree_view.get_model()
            with ExecutionTime("store.clear()"):
                store.clear()

            with ExecutionTime("store.set_from_matches()"):
                store.set_from_matches(enquirer.matches)

            with ExecutionTime("model settle (size=%s)" % len(store)):
                while Gtk.events_pending():
                    Gtk.main_iteration()
        return

    if widget.stamp:
        GObject.source_remove(widget.stamp)
    widget.stamp = GObject.timeout_add(250, _work)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号