It's stupid that it should be at the very top but yeah I fixed it... ¯\_(ツ)_/¯

This commit is contained in:
funilrys 2019-07-13 21:06:30 +02:00
parent 9fbcff27e0
commit 0843d83d09
No known key found for this signature in database
GPG Key ID: 0D8BFEF5515C00C6

View File

@ -1015,6 +1015,31 @@ def write_opening_header(final_file, **header_params):
file_contents = final_file.read() # Save content.
final_file.seek(0) # Write at the top.
if header_params["extensions"]:
if len(header_params["extensions"]) > 1:
write_data(
final_file,
"# Title: StevenBlack/hosts with the {0} and {1} extensions\n#\n".format(
", ".join(header_params["extensions"][:-1]),
header_params["extensions"][-1],
),
)
else:
write_data(
final_file,
"# Title: StevenBlack/hosts with the {0} extension\n#\n".format(
", ".join(header_params["extensions"])
),
)
else:
write_data(
final_file,
"# Title: StevenBlack/hosts\n#\n".format(
", ".join(header_params["extensions"])
),
)
write_data(
final_file,
"# This hosts file is a merged collection "
@ -1034,29 +1059,6 @@ def write_opening_header(final_file, **header_params):
+ "\n",
)
if len(header_params["extensions"]) > 1:
write_data(
final_file,
"# Title: StevenBlack/hosts with the {0} and {1} extensions\n".format(
", ".join(header_params["extensions"][:-1]),
header_params["extensions"][-1],
),
)
else:
write_data(
final_file,
"# Title: StevenBlack/hosts with the {0} extension\n".format(
", ".join(header_params["extensions"])
),
)
else:
write_data(
final_file,
"# Title: StevenBlack/hosts\n".format(
", ".join(header_params["extensions"])
),
)
write_data(
final_file,
(