install

installer
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/install

commit eaa3dd06aac38b075e84ae77a7eea25a2b962f94
parent 797b19da4a911a07bb2ec81a14475759655ad2a4
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Fri, 25 Nov 2016 19:06:07 +0100

Fix(Load_conf): Now loading conf from the load_conf screen:

Not catching any exception in order to test json parsing though.
Same in conf_install.

Diffstat:
Mscreens/conf_install/conf_install.py | 1+
Mscreens/install/install.py | 1+
Mscreens/load_conf/load_conf.py | 17++++++++++++-----
3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/screens/conf_install/conf_install.py b/screens/conf_install/conf_install.py @@ -110,6 +110,7 @@ class Conf_Install: # Load the json into an object with open("morphux_install.conf") as fd: self.conf_lst = json.load(fd) + # TODO catch exception on json.load # Check the configuration integrity if self.check_conf(): # Save this in order not to ask the configuration diff --git a/screens/install/install.py b/screens/install/install.py @@ -54,3 +54,4 @@ class Install: if code == "ok": with open("morphux_install.conf", "w") as fd: json.dump(self.conf_lst, fd) + print(self.conf_lst) diff --git a/screens/load_conf/load_conf.py b/screens/load_conf/load_conf.py @@ -20,6 +20,8 @@ # By: Louis Solofrizzo <louis@morphux.org> ## +import json + class Load_Conf: ## @@ -65,9 +67,14 @@ class Load_Conf: with fd: # All good, we can read the file - data = fd.read() - print(data) - sys.exit(1) - # We do nothing with this file, yet. - return 0 + self.conf_lst = json.load(fd) + + # TODO catch exception on json.load + # Ugly method in order to check conf integrity + Main.screens[1][0].conf_lst = self.conf_lst + if Main.screens[1][0].check_conf(): + self.conf_lst["load_conf"] = True + Main.conf_lst = self.conf_lst + return 6 + return Main.screens[1][0].step_by_step()