if line.startswith(target_ip):
if lines[lines_index].count(" ") < 9:
- lines[lines_index] += " " + line[target_ip_len : line.find("#")].strip()
+ lines[lines_index] += (
+ " " + line[target_ip_len : line.find("#")].strip() # noqa: E203
+ )
else:
lines[lines_index] += "\n"
lines.append(line[: line.find("#")].strip())
+ "\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,
(