From: Steven Black Date: Mon, 8 Feb 2016 00:23:40 +0000 (-0500) Subject: Removed superfluous parens. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=066ae7893c974c5c67438fb01e0d681714a73581;p=stevenblack-hosts.git Removed superfluous parens. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 27dfde2ef..5fb1de0d1 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -111,7 +111,7 @@ def promptForUpdate(): printFailure("ERROR: No 'hosts' file in the folder, try creating one manually") response = query_yes_no("Do you want to update all data sources?") - if (response == "yes"): + if response == "yes": updateAllSources() else: print ('OK, we\'ll stick with what we\'ve got locally.') @@ -120,21 +120,21 @@ def promptForExclusions(): response = query_yes_no("Do you want to exclude any domains?\n" + "For example, hulu.com video streaming must be able to access " + "its tracking and ad servers in order to play video.") - if (response == "yes"): + if response == "yes": displayExclusionOptions() else: 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?") - if (response == "yes"): + if response == "yes": 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"): + if response == "yes": moveHostsFileIntoPlace(finalFile) else: return False @@ -144,21 +144,21 @@ def promptForMove(finalFile): def displayExclusionOptions(): for exclusionOption in COMMON_EXCLUSIONS: response = query_yes_no("Do you want to exclude the domain " + exclusionOption + " ?") - if (response == "yes"): + if response == "yes": excludeDomain(exclusionOption) else: continue response = query_yes_no("Do you want to exclude any other domains?") - if (response == "yes"): + if response == "yes": gatherCustomExclusions() def gatherCustomExclusions(): while True: # Cross-python Input domainFromUser = myInput("Enter the domain you want to exclude (e.g. facebook.com): ") - if (isValidDomainFormat(domainFromUser)): + if isValidDomainFormat(domainFromUser): excludeDomain(domainFromUser) - if (promptForMoreCustomExclusions() == False): + if promptForMoreCustomExclusions() == False: return def excludeDomain(domain): @@ -176,7 +176,7 @@ def matchesExclusions(strippedRule): def updateAllSources(): for source in SOURCES: updateURL = getUpdateURLFromFile(source) - if (updateURL == None): + if updateURL == None: continue; print ('Updating source ' + source + ' from ' + updateURL) # Cross-python call