system_setup: update Summary code
This commit is contained in:
parent
1aac580dfd
commit
365769c365
|
@ -1,5 +1,3 @@
|
|||
import os
|
||||
import pwd
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import logging
|
||||
|
@ -85,21 +83,10 @@ class SummaryController(SubiquityTuiController):
|
|||
|
||||
async def make_ui(self):
|
||||
real_name = ""
|
||||
|
||||
tmp_variant = "wsl_setup"
|
||||
onsite_variant = getattr(self.app, "variant")
|
||||
if onsite_variant is not None:
|
||||
tmp_variant = onsite_variant
|
||||
|
||||
identity = getattr(self.app.client, "identity")
|
||||
if identity is not None:
|
||||
data = await identity.GET()
|
||||
real_name = data.realname
|
||||
if tmp_variant == "wsl_configuration":
|
||||
tmp_uid = os.getuid()
|
||||
if tmp_uid >= 1000 and tmp_uid < 65534:
|
||||
real_name = pwd.getpwuid(tmp_uid)[0]
|
||||
|
||||
self.summary_view = SummaryView(self, real_name)
|
||||
# We may reach the DONE or ERROR state even before we had a chance
|
||||
# to show the UI.
|
||||
|
|
|
@ -25,14 +25,18 @@ class SummaryView(BaseView):
|
|||
|
||||
def __init__(self, controller, real_name):
|
||||
self.controller = controller
|
||||
complete_text = _("Hi {real_name},\n\n"
|
||||
"You have completed the setup!\n\n"
|
||||
"It is suggested to run the following commands"
|
||||
" to update your Ubuntu to the latest version:"
|
||||
"\n\n\n"
|
||||
" $ sudo apt update\n $ sudo apt upgrade\n\n\n"
|
||||
complete_text = _("You have completed the setup!\n\n"
|
||||
"All settings will take effect after next "
|
||||
"restart of Ubuntu.").format(real_name=real_name)
|
||||
"restart of Ubuntu.")
|
||||
if real_name != '':
|
||||
complete_text = _("Hi {real_name},\n\n"
|
||||
"You have completed the setup!\n\n"
|
||||
"It is suggested to run the following commands"
|
||||
" to update your Ubuntu to the latest version:"
|
||||
"\n\n\n"
|
||||
" $ sudo apt update\n $ sudo apt upgrade\n\n\n"
|
||||
"All settings will take effect after next "
|
||||
"restart of Ubuntu.").format(real_name=real_name)
|
||||
|
||||
self.reboot_btn = Toggleable(ok_btn(
|
||||
_("Reboot Now"), on_press=self.reboot))
|
||||
|
|
Loading…
Reference in New Issue