README_TEMPLATE = os.path.join(BASEDIR_PATH, 'readme_template.md')
README_FILE = os.path.join(BASEDIR_PATH, 'readme.md')
TARGET_HOST = '0.0.0.0'
+WHITELIST_FILE = os.path.join(BASEDIR_PATH, 'whitelist')
# Exclusions
EXCLUSION_PATTERN = '([a-zA-Z\d-]+\.){0,}' #append domain the end
+# Exclutions from whitelist file
+EXCLUSIONS = []
+if os.path.isfile(WHITELIST_FILE):
+ with open(WHITELIST_FILE, "r") as ins:
+ for line in ins:
+ EXCLUSIONS.append(line)
+
# Common domains to exclude
COMMON_EXCLUSIONS = ['hulu.com']
def main():
promptForUpdate()
+ excludeFromFile()
promptForExclusions()
mergeFile = createInitialFile()
finalFile = removeDups(mergeFile)
promptForMove(finalFile)
+# Exclusion from file
+def excludeFromFile():
+ for domain in EXCLUSIONS:
+ if (domain != '' and not domain.startswith("#")):
+ domainRegex = re.compile("www\d{0,3}[.]|https?")
+ if not (domainRegex.match(domain)):
+ excludeDomain(domain)
+
# Prompt the User
def promptForUpdate():
response = query_yes_no("Do you want to update all data sources?")