Change update.info files to update.json, update the python generators, and docs.
authorSteven Black <redacted>
Sat, 10 Dec 2016 01:59:43 +0000 (20:59 -0500)
committerSteven Black <redacted>
Sat, 10 Dec 2016 01:59:43 +0000 (20:59 -0500)
37 files changed:
data/KADhosts/update.info [deleted file]
data/KADhosts/update.json [new file with mode: 0644]
data/SpotifyAds/update.info [deleted file]
data/SpotifyAds/update.json [new file with mode: 0644]
data/StevenBlack/update.info [deleted file]
data/StevenBlack/update.json [new file with mode: 0644]
data/Telemetry/update.info [deleted file]
data/Telemetry/update.json [new file with mode: 0644]
data/UncheckyAds/update.info [deleted file]
data/UncheckyAds/update.json [new file with mode: 0644]
data/adaway.org/update.info [deleted file]
data/adaway.org/update.json [new file with mode: 0644]
data/add.2o7Net/update.info [deleted file]
data/add.2o7Net/update.json [new file with mode: 0644]
data/add.Dead/update.info [deleted file]
data/add.Dead/update.json [new file with mode: 0644]
data/add.Risk/update.info [deleted file]
data/add.Risk/update.json [new file with mode: 0644]
data/add.Spam/update.info [deleted file]
data/add.Spam/update.json [new file with mode: 0644]
data/malwaredomainlist.com/update.info [deleted file]
data/malwaredomainlist.com/update.json [new file with mode: 0644]
data/mvps.org/update.info [deleted file]
data/mvps.org/update.json [new file with mode: 0644]
data/someonewhocares.org/update.info [deleted file]
data/someonewhocares.org/update.json [new file with mode: 0644]
data/tyzbit/update.info [deleted file]
data/tyzbit/update.json [new file with mode: 0644]
data/yoyo.org/update.info [deleted file]
data/yoyo.org/update.json [new file with mode: 0644]
extensions/gambling/update.info [deleted file]
extensions/gambling/update.json [new file with mode: 0644]
extensions/porn/update.info [deleted file]
extensions/porn/update.json [new file with mode: 0644]
extensions/social/update.info [deleted file]
extensions/social/update.json [new file with mode: 0644]
updateHostsFile.py

diff --git a/data/KADhosts/update.info b/data/KADhosts/update.info
deleted file mode 100644 (file)
index 41b54a6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/azet12/KADhosts/master/KADhosts.txt
diff --git a/data/KADhosts/update.json b/data/KADhosts/update.json
new file mode 100644 (file)
index 0000000..88790d2
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/azet12/KADhosts/master/KADhosts.txt"
+}
diff --git a/data/SpotifyAds/update.info b/data/SpotifyAds/update.info
deleted file mode 100644 (file)
index f5cae8e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/SpotifyAds/hosts
\ No newline at end of file
diff --git a/data/SpotifyAds/update.json b/data/SpotifyAds/update.json
new file mode 100644 (file)
index 0000000..d4391c3
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/SpotifyAds/hosts"
+}
diff --git a/data/StevenBlack/update.info b/data/StevenBlack/update.info
deleted file mode 100644 (file)
index 6d568b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts
diff --git a/data/StevenBlack/update.json b/data/StevenBlack/update.json
new file mode 100644 (file)
index 0000000..9b240a0
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts"
+}
diff --git a/data/Telemetry/update.info b/data/Telemetry/update.info
deleted file mode 100644 (file)
index 91f5553..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/Telemetry/hosts
diff --git a/data/Telemetry/update.json b/data/Telemetry/update.json
new file mode 100644 (file)
index 0000000..674dd8b
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/Telemetry/hosts"
+}
diff --git a/data/UncheckyAds/update.info b/data/UncheckyAds/update.info
deleted file mode 100644 (file)
index 0e8bd8f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts
diff --git a/data/UncheckyAds/update.json b/data/UncheckyAds/update.json
new file mode 100644 (file)
index 0000000..a5b776e
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts"
+}
diff --git a/data/adaway.org/update.info b/data/adaway.org/update.info
deleted file mode 100644 (file)
index d1a4848..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt
diff --git a/data/adaway.org/update.json b/data/adaway.org/update.json
new file mode 100644 (file)
index 0000000..4ee478a
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt"
+}
diff --git a/data/add.2o7Net/update.info b/data/add.2o7Net/update.info
deleted file mode 100644 (file)
index 82e94d2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts
diff --git a/data/add.2o7Net/update.json b/data/add.2o7Net/update.json
new file mode 100644 (file)
index 0000000..c1c13f7
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts"
+}
diff --git a/data/add.Dead/update.info b/data/add.Dead/update.info
deleted file mode 100644 (file)
index 9c4fafc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Dead/hosts
diff --git a/data/add.Dead/update.json b/data/add.Dead/update.json
new file mode 100644 (file)
index 0000000..441f2a4
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Dead/hosts"
+}
diff --git a/data/add.Risk/update.info b/data/add.Risk/update.info
deleted file mode 100644 (file)
index a54db4b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
diff --git a/data/add.Risk/update.json b/data/add.Risk/update.json
new file mode 100644 (file)
index 0000000..ac75bf4
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts"
+}
diff --git a/data/add.Spam/update.info b/data/add.Spam/update.info
deleted file mode 100644 (file)
index 0d25247..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts
diff --git a/data/add.Spam/update.json b/data/add.Spam/update.json
new file mode 100644 (file)
index 0000000..2a738df
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts"
+}
diff --git a/data/malwaredomainlist.com/update.info b/data/malwaredomainlist.com/update.info
deleted file mode 100644 (file)
index c612bfb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://www.malwaredomainlist.com/hostslist/hosts.txt
diff --git a/data/malwaredomainlist.com/update.json b/data/malwaredomainlist.com/update.json
new file mode 100644 (file)
index 0000000..6556f83
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://www.malwaredomainlist.com/hostslist/hosts.txt"
+}
diff --git a/data/mvps.org/update.info b/data/mvps.org/update.info
deleted file mode 100644 (file)
index 8e9f6a1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-http://winhelp2002.mvps.org/hosts.txt
diff --git a/data/mvps.org/update.json b/data/mvps.org/update.json
new file mode 100644 (file)
index 0000000..578abdc
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "http://winhelp2002.mvps.org/hosts.txt"
+}
diff --git a/data/someonewhocares.org/update.info b/data/someonewhocares.org/update.info
deleted file mode 100644 (file)
index bb744a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-http://someonewhocares.org/hosts/zero/hosts
diff --git a/data/someonewhocares.org/update.json b/data/someonewhocares.org/update.json
new file mode 100644 (file)
index 0000000..c8280fb
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "http://someonewhocares.org/hosts/zero/hosts"
+}
diff --git a/data/tyzbit/update.info b/data/tyzbit/update.info
deleted file mode 100644 (file)
index 766f885..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/tyzbit/hosts/master/data/tyzbit/hosts
diff --git a/data/tyzbit/update.json b/data/tyzbit/update.json
new file mode 100644 (file)
index 0000000..49450a5
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/tyzbit/hosts/master/data/tyzbit/hosts"
+}
diff --git a/data/yoyo.org/update.info b/data/yoyo.org/update.info
deleted file mode 100644 (file)
index 65a21d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0
diff --git a/data/yoyo.org/update.json b/data/yoyo.org/update.json
new file mode 100644 (file)
index 0000000..29b57f8
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0"
+}
diff --git a/extensions/gambling/update.info b/extensions/gambling/update.info
deleted file mode 100644 (file)
index dae0121..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/gambling-hosts
diff --git a/extensions/gambling/update.json b/extensions/gambling/update.json
new file mode 100644 (file)
index 0000000..b9802ed
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/gambling-hosts"
+}
diff --git a/extensions/porn/update.info b/extensions/porn/update.info
deleted file mode 100644 (file)
index c2eab00..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/pornography-hosts
\ No newline at end of file
diff --git a/extensions/porn/update.json b/extensions/porn/update.json
new file mode 100644 (file)
index 0000000..b138802
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/pornography-hosts"
+}
diff --git a/extensions/social/update.info b/extensions/social/update.info
deleted file mode 100644 (file)
index 02f045c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/social-hosts
diff --git a/extensions/social/update.json b/extensions/social/update.json
new file mode 100644 (file)
index 0000000..67cb516
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "url": "https://raw.githubusercontent.com/Sinfonietta/hostfiles/master/social-hosts"
+}
index f4c7e70f5d711684087f43fd701c8f38daecc1c8..975e71c1480188152370827a8dd645e1e7873c7c 100644 (file)
@@ -87,7 +87,7 @@ defaults = {
     "datafilenames" : "hosts",
     "targetip" : "0.0.0.0",
     "ziphosts" : False,
-    "updateurlfilename" : "update.info",
+    "sourcedatafilename" : "update.json",
     "readmefilename" : "readme.md",
     "readmetemplate" : os.path.join(BASEDIR_PATH, "readme_template.md"),
     "readmedata" : {},
@@ -260,14 +260,14 @@ def updateAllSources():
                     print ("Skipping.")
 
 def getUpdateURLsFromFile(source):
-    pathToUpdateFile = os.path.join(settings["datapath"], source, settings["updateurlfilename"])
+    pathToUpdateFile = os.path.join(settings["datapath"], source, settings["sourcedatafilename"])
     if os.path.exists(pathToUpdateFile):
         updateFile = open(pathToUpdateFile, "r")
-        retURLs     = updateFile.readlines()
-        # .strip()
+        updateData = json.load(updateFile)
+        retURLs    = [updateData["url"]]
         updateFile.close()
     else:
-        retURL = None
+        retURLs = None
         printFailure("Warning: Can't find the update file for source " + source + "\n" +
                      "Make sure that there's a file at " + pathToUpdateFile)
     return retURLs
@@ -275,10 +275,11 @@ def getUpdateURLsFromFile(source):
 
 
 def getUpdateURLFromFile(source):
-    pathToUpdateFile = os.path.join(settings["datapath"], source, settings["updateurlfilename"])
+    pathToUpdateFile = os.path.join(settings["datapath"], source, settings["sourcedatafilename"])
     if os.path.exists(pathToUpdateFile):
         with open(pathToUpdateFile, "r") as updateFile:
-            return updateFile.readline().strip()
+            updateData = json.load(updateFile)
+            return [updateData["url"]]
     printFailure("Warning: Can't find the update file for source " + source + "\n" +
                  "Make sure that there's a file at " + pathToUpdateFile)
     return None
git clone https://git.99rst.org/PROJECT