[displaymanager] Fix config loading-and-saving

- toml.dump() takes a file-like object
 - toml.loads() takes a whole string to parse, (e.g. the TOML data),
   not a pathname, so change to toml.load() which takes a file-like
   object.
This commit is contained in:
Adriaan de Groot 2021-11-15 12:11:53 +01:00
parent 54fd81a87e
commit ce6aec158a

View File

@ -855,7 +855,8 @@ class DMgreetd(DisplayManager):
import toml
if (os.path.exists(self.config_path())):
self.config_data = toml.loads(self.config_path())
with open(self.config_path(), "r") as f:
self.config_data = toml.load(f)
self.config_data['terminal'] = dict(vt = "next")
@ -869,7 +870,8 @@ class DMgreetd(DisplayManager):
def config_write(self):
import toml
toml.dump(self.config_data, self.config_path())
with open(self.config_path(), "w") as f:
toml.dump(self.config_data, f)
def basic_setup(self):
if libcalamares.utils.target_env_call(