Quiet Hosts Calculator Added

This commit is contained in:
2025-09-26 16:18:53 -04:00
parent b82b4a0f1b
commit 8462e3adf5
3 changed files with 109 additions and 23 deletions
+30 -20
View File
@@ -436,26 +436,7 @@ def prepare_to_enforce(url, bad_publisher_list, pups, badpathparts, threat_toler
if choice == "1":
while True:
choice, policynames, policyid = listPolicies(url)
selected_policy = policynames[choice]
if selected_policy not in policylist:
policylist.append(selected_policy)
while True:
answer = input(ct.colorText("Do you want to load another policy? (yes/no): ", "white")).strip().lower()
if answer in ("no", "n"):
break # Exit the inner loop and then the outer loop
elif answer in ("yes", "y"):
break # Exit the inner loop and continue the outer loop
else:
print(ct.colorText("Please answer with 'yes' or 'no'.", "red"))
if answer in ("no", "n"):
break
print(policylist)
policylist, policyids = getMultiplePolicySelections(url)
elif choice == "2":
@@ -609,3 +590,32 @@ def savePreFlights(appr_base_dir, parq_base_dir, pflight_base_dir):
df.to_parquet(f"{parq_base_dir}{name}.parquet", index=False)
ct.style_dataframe_dark(df, f"{pflight_base_dir}{name}.html")
def getMultiplePolicySelections(url):
policynameslist = []
policyidlist = []
while True:
choice, policynames, policyid = listPolicies(url)
selected_policy = policynames[choice]
selected_policyid = policyid[choice]
if selected_policy not in policynameslist:
policynameslist.append(selected_policy)
if selected_policyid not in policyidlist:
policyidlist.append(selected_policyid)
while True:
answer = input(ct.colorText("Do you want to load another policy? (yes/no): ", "white")).strip().lower()
if answer in ("no", "n"):
break # Exit the inner loop and then the outer loop
elif answer in ("yes", "y"):
break # Exit the inner loop and continue the outer loop
else:
print(ct.colorText("Please answer with 'yes' or 'no'.", "red"))
if answer in ("no", "n"):
break
return policynameslist, policyidlist