X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/5eb95c31a8eb6c13d27dcceb5510f2d9c6a04d71..2a2097f4ff99287c84bee69f5116cffdc90e73b1:/tools/helpers/props.py diff --git a/tools/helpers/props.py b/tools/helpers/props.py index de3c3a8..8b6ca5b 100644 --- a/tools/helpers/props.py +++ b/tools/helpers/props.py @@ -21,34 +21,18 @@ def host_set(args, prop, value): tools.helpers.run.user(args, command) def get(args, prop): - if os.path.exists(tools.config.session_defaults["config_path"]): - session_cfg = tools.config.load_session() - if session_cfg["session"]["state"] == "RUNNING": - platformService = IPlatform.get_service(args) - if platformService: - return platformService.getprop(prop, "") - else: - logging.error("Failed to access IPlatform service") - else: - logging.error("WayDroid container is {}".format( - session_cfg["session"]["state"])) + platformService = IPlatform.get_service(args) + if platformService: + return platformService.getprop(prop, "") else: - logging.error("WayDroid session is stopped") + logging.error("Failed to access IPlatform service") def set(args, prop, value): - if os.path.exists(tools.config.session_defaults["config_path"]): - session_cfg = tools.config.load_session() - if session_cfg["session"]["state"] == "RUNNING": - platformService = IPlatform.get_service(args) - if platformService: - platformService.setprop(prop, value) - else: - logging.error("Failed to access IPlatform service") - else: - logging.error("WayDroid container is {}".format( - session_cfg["session"]["state"])) + platformService = IPlatform.get_service(args) + if platformService: + platformService.setprop(prop, value) else: - logging.error("WayDroid session is stopped") + logging.error("Failed to access IPlatform service") def file_get(args, file, prop): with open(file) as build_prop: @@ -58,5 +42,5 @@ def file_get(args, file, prop): continue k,v = line.partition("=")[::2] if k == prop: - return v; + return v return ""