Debian Codegraph @

pkg/packagekit/callTracer.py

raw
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2 import json
3
4 from tracer.query import Query
5
6 q = Query()
7 applications = q.affected_applications().get()
8
9
10 def filter_by_type(apps, type_str):
11 return [app.name for app in apps if app.type == type_str]
12
13
14 dump_obj = {}
15 # ignore type "session" for cockpit use case
16 dump_obj["reboot"] = filter_by_type(applications, "static")
17 dump_obj["daemons"] = filter_by_type(applications, "daemon")
18 dump_obj["manual"] = filter_by_type(applications, "application")
19
20 print(json.dumps(dump_obj))