mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-09-18 00:01:02 +02:00
Merge pull request #1307 from funilrys/issue-1166-bis
Fix location issue under windows
This commit is contained in:
commit
2565d15719
|
@ -1743,9 +1743,7 @@ class TestIsValidDomainFormat(BaseStdout):
|
|||
self.assertTrue(expected in output)
|
||||
|
||||
def test_invalid_domain(self):
|
||||
expected = (
|
||||
"Do not include www.domain.com or http(s)://domain.com. Try again."
|
||||
)
|
||||
expected = "Do not include www.domain.com or http(s)://domain.com. Try again."
|
||||
|
||||
for invalid_domain in [
|
||||
"www.subdomain.domain",
|
||||
|
|
|
@ -1089,12 +1089,7 @@ def write_opening_header(final_file, **header_params):
|
|||
),
|
||||
)
|
||||
else:
|
||||
write_data(
|
||||
final_file,
|
||||
"# Title: StevenBlack/hosts\n#\n".format(
|
||||
", ".join(header_params["extensions"])
|
||||
),
|
||||
)
|
||||
write_data(final_file, "# Title: StevenBlack/hosts\n#\n")
|
||||
|
||||
write_data(
|
||||
final_file,
|
||||
|
@ -1210,6 +1205,11 @@ def update_readme_data(readme_file, **readme_updates):
|
|||
readme_data = json.load(f)
|
||||
readme_data[extensions_key] = generation_data
|
||||
|
||||
for denomination, data in readme_data.copy().items():
|
||||
if "location" in data and data["location"] and "\\" in data["location"]:
|
||||
# Windows compatibility: #1166
|
||||
readme_data[denomination]["location"] = data["location"].replace("\\", "/")
|
||||
|
||||
with open(readme_file, "w") as f:
|
||||
json.dump(readme_data, f)
|
||||
|
||||
|
|
|
@ -80,7 +80,10 @@ def main():
|
|||
source_rows += t.substitute(this_row) + "\n"
|
||||
|
||||
with open(
|
||||
os.path.join(data[key]["location"], README_FILENAME), "wt", encoding="utf-8", newline="\n"
|
||||
os.path.join(data[key]["location"], README_FILENAME),
|
||||
"wt",
|
||||
encoding="utf-8",
|
||||
newline="\n",
|
||||
) as out:
|
||||
for line in open(README_TEMPLATE, encoding="utf-8", newline="\n"):
|
||||
line = line.replace(
|
||||
|
|
Loading…
Reference in New Issue
Block a user