From: funilrys Date: Sat, 13 Jul 2019 19:06:30 +0000 (+0200) Subject: It's stupid that it should be at the very top but yeah I fixed it... ¯\_(ツ)_/¯ X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=0843d83d09179d96b8d931269c9650829c06b7f1;p=stevenblack-hosts.git It's stupid that it should be at the very top but yeah I fixed it... ¯\_(ツ)_/¯ --- diff --git a/updateHostsFile.py b/updateHostsFile.py index e554fe891..645ccb90f 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -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, (