It's stupid that it should be at the very top but yeah I fixed it... ¯\_(ツ)_/¯
authorfunilrys <redacted>
Sat, 13 Jul 2019 19:06:30 +0000 (21:06 +0200)
committerfunilrys <redacted>
Sat, 13 Jul 2019 19:06:30 +0000 (21:06 +0200)
updateHostsFile.py

index e554fe891a3e98d85825857d01dca74a6623b18d..645ccb90f6d7864d7f65f8573b9c1e8f4a9c3cd1 100644 (file)
@@ -1015,29 +1015,12 @@ def write_opening_header(final_file, **header_params):
     file_contents = final_file.read()  # Save content.
 
     final_file.seek(0)  # Write at the top.
-    write_data(
-        final_file,
-        "# This hosts file is a merged collection "
-        "of hosts from reputable sources,\n",
-    )
-    write_data(final_file, "# with a dash of crowd sourcing via Github\n#\n")
-    write_data(
-        final_file,
-        "# Date: " + time.strftime("%d %B %Y %H:%M:%S (%Z)", time.gmtime()) + "\n",
-    )
 
     if header_params["extensions"]:
-        write_data(
-            final_file,
-            "# Extensions added to this file: "
-            + ", ".join(header_params["extensions"])
-            + "\n",
-        )
-
         if len(header_params["extensions"]) > 1:
             write_data(
                 final_file,
-                "# Title: StevenBlack/hosts with the {0} and {1} extensions\n".format(
+                "# Title: StevenBlack/hosts with the {0} and {1} extensions\n#\n".format(
                     ", ".join(header_params["extensions"][:-1]),
                     header_params["extensions"][-1],
                 ),
@@ -1045,18 +1028,37 @@ def write_opening_header(final_file, **header_params):
         else:
             write_data(
                 final_file,
-                "# Title: StevenBlack/hosts with the {0} extension\n".format(
+                "# Title: StevenBlack/hosts with the {0} extension\n#\n".format(
                     ", ".join(header_params["extensions"])
                 ),
             )
     else:
         write_data(
             final_file,
-            "# Title: StevenBlack/hosts\n".format(
+            "# Title: StevenBlack/hosts\n#\n".format(
                 ", ".join(header_params["extensions"])
             ),
         )
 
+    write_data(
+        final_file,
+        "# This hosts file is a merged collection "
+        "of hosts from reputable sources,\n",
+    )
+    write_data(final_file, "# with a dash of crowd sourcing via Github\n#\n")
+    write_data(
+        final_file,
+        "# Date: " + time.strftime("%d %B %Y %H:%M:%S (%Z)", time.gmtime()) + "\n",
+    )
+
+    if header_params["extensions"]:
+        write_data(
+            final_file,
+            "# Extensions added to this file: "
+            + ", ".join(header_params["extensions"])
+            + "\n",
+        )
+
     write_data(
         final_file,
         (
git clone https://git.99rst.org/PROJECT