Quiet Hosts Calculator Added
This commit is contained in:
+30
-20
@@ -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
|
||||
Reference in New Issue
Block a user