install

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

commit c1f52586fa5e369764116b9dca51d39f196fb9d2
parent b631e193bce29d36eec64a67a0a4982e06deecc4
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon,  5 Dec 2016 18:41:19 +0100

Add(Installation progress): WIP

Diffstat:
Mscreens/install/install.py | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/screens/install/install.py b/screens/install/install.py @@ -50,6 +50,8 @@ class Install: total_sbus = 0 # Total SBU to install the system current_time = 0 # Current install time in_install = 0 + current_install = [] # Object used to save the installation progress + def_install = ".install" # Default path for the install progress file ## # Functions @@ -524,6 +526,7 @@ class Install: self.sbu_time = (time.time() - start) self.global_progress_bar(reset=True) + self.update_install_file(pkg[1]) if pkg[1]["next"] in lst: pkg = lst[pkg[1]["next"]] else: @@ -620,3 +623,15 @@ class Install: # Abort the installation sys.exit(1) + + # This function update the install file (.install) by default + # If an install fail, or is quitted, we can resume it later + def update_install_file(self, conf): + # Update the object + self.current_install.append(conf) + + # Open the install file + with open(self.def_install, "w") as fd: + # Dump the current install progress + json.dump(self.current_install, fd) + fd.close()