Remove references to .zip files in the generator programs.

This commit is contained in:
Steven Black
2017-08-20 12:00:19 -04:00
parent 59c595ebcb
commit 68dcf5c125
3 changed files with 16 additions and 31 deletions

View File

@@ -59,56 +59,56 @@ def main():
"data subfolders.") "data subfolders.")
parser.parse_args() parser.parse_args()
update_hosts_file("-a", "-z", "-o", update_hosts_file("-a", "-o",
"alternates/gambling", "alternates/gambling",
"-e", "gambling") "-e", "gambling")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/porn", "alternates/porn",
"-e", "porn") "-e", "porn")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/social", "alternates/social",
"-e", "social") "-e", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews", "alternates/fakenews",
"-e", "fakenews") "-e", "fakenews")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-gambling", "alternates/fakenews-gambling",
"-e", "fakenews", "gambling") "-e", "fakenews", "gambling")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-porn", "alternates/fakenews-porn",
"-e", "fakenews", "porn") "-e", "fakenews", "porn")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-social", "alternates/fakenews-social",
"-e", "fakenews", "social") "-e", "fakenews", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/gambling-porn", "alternates/gambling-porn",
"-e", "gambling", "porn") "-e", "gambling", "porn")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/gambling-social", "alternates/gambling-social",
"-e", "gambling", "social") "-e", "gambling", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/porn-social", "alternates/porn-social",
"-e", "porn", "social") "-e", "porn", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-gambling-porn", "alternates/fakenews-gambling-porn",
"-e", "fakenews", "gambling", "porn") "-e", "fakenews", "gambling", "porn")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-gambling-social", "alternates/fakenews-gambling-social",
"-e", "fakenews", "gambling", "social") "-e", "fakenews", "gambling", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-porn-social", "alternates/fakenews-porn-social",
"-e", "fakenews", "porn", "social") "-e", "fakenews", "porn", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/gambling-porn-social", "alternates/gambling-porn-social",
"-e", "gambling", "porn", "social") "-e", "gambling", "porn", "social")
update_hosts_file("-a", "-z", "-n", "-o", update_hosts_file("-a", "-n", "-o",
"alternates/fakenews-gambling-porn-social", "alternates/fakenews-gambling-porn-social",
"-e", "fakenews", "gambling", "porn", "social") "-e", "fakenews", "gambling", "porn", "social")
update_hosts_file("-a", "-z", "-n") update_hosts_file("-a", "-n")
# Update the readme files. # Update the readme files.
update_readme_file() update_readme_file()

View File

@@ -23,7 +23,6 @@ import fnmatch
import argparse import argparse
import socket import socket
import json import json
import zipfile
# Detecting Python 3 for version-dependent implementations # Detecting Python 3 for version-dependent implementations
PY3 = sys.version_info >= (3, 0) PY3 = sys.version_info >= (3, 0)
@@ -66,7 +65,6 @@ def get_defaults():
"outputsubfolder": "", "outputsubfolder": "",
"hostfilename": "hosts", "hostfilename": "hosts",
"targetip": "0.0.0.0", "targetip": "0.0.0.0",
"ziphosts": False,
"sourcedatafilename": "update.json", "sourcedatafilename": "update.json",
"sourcesdata": [], "sourcesdata": [],
"readmefilename": "readme.md", "readmefilename": "readme.md",
@@ -102,10 +100,6 @@ def main():
parser.add_argument("--keepdomaincomments", "-k", parser.add_argument("--keepdomaincomments", "-k",
dest="keepdomaincomments", default=False, dest="keepdomaincomments", default=False,
help="Keep domain line comments.") help="Keep domain line comments.")
parser.add_argument("--zip", "-z", dest="ziphosts", default=False,
action="store_true", help="Additionally create "
"a zip archive of the "
"hosts file.")
parser.add_argument("--noupdate", "-n", dest="noupdate", default=False, parser.add_argument("--noupdate", "-n", dest="noupdate", default=False,
action="store_true", help="Don't update from " action="store_true", help="Don't update from "
"host data sources.") "host data sources.")
@@ -182,13 +176,6 @@ def main():
skipstatichosts=skip_static_hosts) skipstatichosts=skip_static_hosts)
final_file.close() final_file.close()
if settings["ziphosts"]:
zf = zipfile.ZipFile(path_join_robust(output_subfolder,
"hosts.zip"), mode='w')
zf.write(path_join_robust(output_subfolder, "hosts"),
compress_type=zipfile.ZIP_DEFLATED, arcname='hosts')
zf.close()
update_readme_data(settings["readmedatafilename"], update_readme_data(settings["readmedatafilename"],
extensions=extensions, extensions=extensions,
numberofrules=number_of_rules, numberofrules=number_of_rules,

View File

@@ -27,8 +27,6 @@ def main():
'hosts/blob/master/${location}readme.md) | ' 'hosts/blob/master/${location}readme.md) | '
'[link](https://raw.githubusercontent.com/StevenBlack/' '[link](https://raw.githubusercontent.com/StevenBlack/'
'hosts/master/${location}hosts) | [link]' 'hosts/master/${location}hosts) | [link]'
'(https://raw.githubusercontent.com/StevenBlack/hosts/'
'master/${location}hosts.zip) | ${fmtentries} | '
'[link](http://sbc.io/hosts/${location}hosts)') '[link](http://sbc.io/hosts/${location}hosts)')
with open(README_DATA_FILENAME, 'r') as f: with open(README_DATA_FILENAME, 'r') as f: