mirror of
https://github.com/StevenBlack/hosts.git
synced 2025-03-14 10:36:53 +00:00
It's stupid that it should be at the very top but yeah I fixed it... ¯\_(ツ)_/¯
This commit is contained in:
@ -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,
|
||||
(
|
||||
|
Reference in New Issue
Block a user