From: Ben Limmer Date: Tue, 30 Jul 2013 16:59:31 +0000 (-0600) Subject: Added query to user for moving the hosts file into place. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=16e922cdd627046642897add13fe6888cc6cec5c;p=stevenblack-hosts.git Added query to user for moving the hosts file into place. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 805f9ad74..231ea090d 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -42,7 +42,7 @@ def main(): finalizeFile(finalFile) updateReadme(numberOfRules) printSuccess('Success! Your shiny new hosts file has been prepared.\nIt contains ' + str(numberOfRules) + ' unique entries.') - moveHostsFileIntoPlace(finalFile) + promptForMove(finalFile) # Prompt the User def promptForUpdate(): @@ -67,6 +67,13 @@ def promptForMoreCustomExclusions(): return True else: return False + +def promptForMove(finalFile): + response = query_yes_no("Do you want to replace your existing hosts file with the newly generated file?") + if (response == "yes"): + moveHostsFileIntoPlace(finalFile) + else: + return False # End Prompt the User # Exclusion logic