mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +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.
|
file_contents = final_file.read() # Save content.
|
||||||
|
|
||||||
final_file.seek(0) # Write at the top.
|
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(
|
write_data(
|
||||||
final_file,
|
final_file,
|
||||||
"# This hosts file is a merged collection "
|
"# This hosts file is a merged collection "
|
||||||
@@ -1034,29 +1059,6 @@ def write_opening_header(final_file, **header_params):
|
|||||||
+ "\n",
|
+ "\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(
|
write_data(
|
||||||
final_file,
|
final_file,
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user