install

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

commit f18108f5c3e9fdcd3ec344f4aefe3e750473d9e6
parent c1c2b4f07532d164030338ffe3c85df81574c540
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Tue, 15 Nov 2016 18:36:56 +0100

Add(conf_install): Step by step menu on cancel

Diffstat:
Mscreens/conf_install/conf_install.py | 24++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/screens/conf_install/conf_install.py b/screens/conf_install/conf_install.py @@ -28,7 +28,7 @@ class Conf_Install: dlg = 0 conf_lst = {} - + ## # Functions ## @@ -39,15 +39,35 @@ class Conf_Install: "id": 1, "name": "Installation" } + self.inst_step = [ + {"Hostname": [self.hostname, "Set machine hostname"]}, + {"Root password": [self.root_password, "Set root password"]}, + {"Abort": [False, "Return to menu, reset configuration"]} + ] return self.config def main(self): if (self.hostname()): return 0 if (self.root_password()): - return 0 + return self.step_by_step() return 2 + def step_by_step(self): + choices = [] + for c in self.inst_step: + for k, v in c.items(): + choices.append((k, v[1])) + code, tag = self.dlg.menu("Choose a step in the installation", choices=choices, title="Step by Step") + if (tag != "Abort" and code != "cancel"): + for c in self.inst_step: + for k, v in c.items(): + if k == tag: + v[0]() + return self.step_by_step() + else: + return 0 + def hostname(self): string = "" while string == "":