Adds a timer to post install screen (#4028)
* Add timer to end screen of guided * ruff check
This commit is contained in:
parent
9e7a5f6931
commit
e5ccdb0c1c
|
|
@ -268,8 +268,12 @@ def add_number_of_parallel_downloads(preset: int | None = None) -> int | None:
|
|||
return downloads
|
||||
|
||||
|
||||
def ask_post_installation() -> PostInstallationAction:
|
||||
header = tr('Installation completed') + '\n\n'
|
||||
def ask_post_installation(elapsed_time: float | None = None) -> PostInstallationAction:
|
||||
header = 'Installation completed'
|
||||
if elapsed_time is not None:
|
||||
minutes = int(elapsed_time // 60)
|
||||
seconds = int(elapsed_time % 60)
|
||||
header += f' in {minutes}m {seconds}s' + '\n'
|
||||
header += tr('What would you like to do next?') + '\n'
|
||||
|
||||
items = [MenuItem(action.value, value=action) for action in PostInstallationAction]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from archinstall import SysInfo
|
||||
|
|
@ -53,6 +54,7 @@ def perform_installation(mountpoint: Path) -> None:
|
|||
Only requirement is that the block devices are
|
||||
formatted and setup prior to entering this function.
|
||||
"""
|
||||
start_time = time.time()
|
||||
info('Starting installation...')
|
||||
|
||||
config = arch_config_handler.config
|
||||
|
|
@ -168,7 +170,8 @@ def perform_installation(mountpoint: Path) -> None:
|
|||
|
||||
if not arch_config_handler.args.silent:
|
||||
with Tui():
|
||||
action = ask_post_installation()
|
||||
elapsed_time = time.time() - start_time
|
||||
action = ask_post_installation(elapsed_time)
|
||||
|
||||
match action:
|
||||
case PostInstallationAction.EXIT:
|
||||
|
|
|
|||
Loading…
Reference in New Issue