Suppress marginal messages in --auto mode.
authorSteven Black <redacted>
Sun, 14 Feb 2016 02:06:37 +0000 (21:06 -0500)
committerSteven Black <redacted>
Sun, 14 Feb 2016 02:06:37 +0000 (21:06 -0500)
updateHostsFile.py

index fc2f67e29f92794abce9f29b7f3236a136f4d6cd..717c0b6b8377495925a0a1bb672764b221afb5bd 100644 (file)
@@ -93,13 +93,14 @@ exclusionRegexs = []
 numberOfRules   = 0
 
 auto = False
+verbose = True
 
 def main():
     parser = argparse.ArgumentParser(description="Creates an amalgamated hosts file from hosts stored in data subfolders.")
     parser.add_argument("--auto", "-a", dest="auto", default=False, action='store_true', help="Run without prompting.")
     args = parser.parse_args()
 
-    global auto
+    global auto, verbose
     auto = args.auto
 
     promptForUpdate()
@@ -127,7 +128,8 @@ def promptForUpdate():
     if response == "yes":
         updateAllSources()
     else:
-        print ("OK, we\'ll stick with what we\'ve  got locally.")
+        if not auto:
+            print ("OK, we\'ll stick with what we\'ve  got locally.")
 
 def promptForExclusions():
     response = "no" if auto else query_yes_no("Do you want to exclude any domains?\n" +
@@ -136,7 +138,8 @@ def promptForExclusions():
     if response == "yes":
         displayExclusionOptions()
     else:
-        print ("OK, we\'ll only exclude domains in the whitelist.")
+        if not auto:
+            print ("OK, we\'ll only exclude domains in the whitelist.")
 
 def promptForMoreCustomExclusions():
     response = query_yes_no("Do you have more domains you want to enter?")
git clone https://git.99rst.org/PROJECT