PackageKitGlib fail to do asynchronous search for package

Asked by Lester Carballo Pérez

This code generate a core dump also the equivalent on cjs. My error? The synchronous version works well. Occurs the same on ubuntu 13.10 and 14.04. I install packagekit on 13.10 and the same things...

#! /usr/bin/python3
# -*- coding: utf-8 -*-

from gi.repository import GObject
from gi.repository import PackageKitGlib as packagekit

def main():
    """Run a test application"""
    loop = GObject.MainLoop()
    pk = packagekit.Client()
    pk.search_names_async(0, ["xterm",], None, progress_cb, None, out_data, None)
    print("exec")
    loop.run()

def progress_cb(status, typ, data=None):
    if status.get_property('package'):
        print("Pachet " + status.get_property('package') + " " + status.get_property('package-id'))
    print(str(typ))

def out_data(p):
    print("ready")
    loop.quit()

if __name__ == "__main__":
    main()

Thanks.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu packagekit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.