1python primport_handler () {
2    import bb.event
3    if not e.data:
4        return
5
6    if isinstance(e, bb.event.ParseCompleted):
7        import oe.prservice
8        #import all exported AUTOPR values
9        imported = oe.prservice.prserv_import_db(e.data)
10        if imported is None:
11            bb.fatal("import failed!")
12
13        for (version, pkgarch, checksum, value) in imported:
14            bb.note("imported (%s,%s,%s,%d)" % (version, pkgarch, checksum, value))
15    elif isinstance(e, bb.event.ParseStarted):
16        import oe.prservice
17        oe.prservice.prserv_check_avail(e.data)
18}
19
20addhandler primport_handler
21primport_handler[eventmask] = "bb.event.ParseCompleted bb.event.ParseStarted"
22