Update main.py

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2022-08-29 10:34:57 +07:00
parent 2f8df1b4a4
commit b637985c2f

17
main.py
View File

@@ -1,3 +1,6 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from sys import exit from sys import exit
from os import getcwd, remove, system from os import getcwd, remove, system
from os.path import isfile, exists from os.path import isfile, exists
@@ -81,9 +84,9 @@ apps = [
"Microsoft.MicrosoftStickyNotes", "Microsoft.MicrosoftStickyNotes",
"Microsoft.MixedReality.Portal", "Microsoft.MixedReality.Portal",
"Microsoft.Office.OneNote", "Microsoft.Office.OneNote",
"Microsoft.OneConnect", "Microsoft.OneConnect", # W10?
"Microsoft.People", "Microsoft.People",
"Microsoft.Print3D", "Microsoft.Print3D", # W10?
"Microsoft.ScreenSketch", # Скриншоты (W10 1809+) "Microsoft.ScreenSketch", # Скриншоты (W10 1809+)
"Microsoft.SkypeApp", "Microsoft.SkypeApp",
"Microsoft.Xbox.TCUI", # Xbox Live (W11) "Microsoft.Xbox.TCUI", # Xbox Live (W11)
@@ -121,10 +124,9 @@ def is_admin():
def ask_input(message, checking_func): def ask_input(message, checking_func):
user_input = input(message) user_input = input(message)
if not user_input or len(user_input) == 0 or not checking_func(user_input): if user_input and checking_func(user_input):
ask_input(message, checking_func)
else:
return user_input return user_input
ask_input(message, checking_func)
def convert_applist_to_string(is_w11): def convert_applist_to_string(is_w11):
@@ -168,9 +170,8 @@ def main():
# subprocess.Popen("powershell Unblock-File -Path {}".format(ps_script_path)).wait() # subprocess.Popen("powershell Unblock-File -Path {}".format(ps_script_path)).wait()
subprocess.Popen("powershell {}".format(ps_script_path)).wait() subprocess.Popen("powershell {}".format(ps_script_path)).wait()
subprocess.Popen("{}".format(bat_script_path)).wait() subprocess.Popen("{}".format(bat_script_path)).wait()
properties.get("wim")["path"] = "" for key in properties.keys():
properties.get("mnt")["path"] = "" properties[key]["path"] = ""
properties.get("upd")["path"] = ""
do_cleanup() do_cleanup()
print("Затраченное время:", round((time()-time_start) / 60)) print("Затраченное время:", round((time()-time_start) / 60))