]> glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/config/save.py
clipboard: Return empty string if error
[waydroid.git] / tools / config / save.py
1 # Copyright 2021 Oliver Smith
2 # SPDX-License-Identifier: GPL-3.0-or-later
3 import os
4 import logging
5 import tools.config
6
7
8 def save(args, cfg):
9 logging.debug("Save config: " + args.config)
10 os.makedirs(os.path.dirname(args.config), 0o700, True)
11 with open(args.config, "w") as handle:
12 cfg.write(handle)
13
14 def save_session(cfg):
15 config_path = tools.config.session_defaults["config_path"]
16 logging.debug("Save session config: " + config_path)
17 os.makedirs(os.path.dirname(config_path), 0o700, True)
18 with open(config_path, "w") as handle:
19 cfg.write(handle)