Skip to content

Commit

Permalink
web/generate-site.py: use unix line endings
Browse files Browse the repository at this point in the history
fixes #15
  • Loading branch information
classabbyamp committed Feb 29, 2024
1 parent 64d5abf commit 35b1eb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/generate-site.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
}


class CsvDialect(csv.excel_tab):
lineterminator = "\n"


def write_api(destdir: Path, data: list[dict]):
apidir = destdir / "v0"
apidir.mkdir(parents=True)
Expand Down Expand Up @@ -77,7 +81,7 @@ def write_raw(destdir: Path, data: list[dict]):
rawdir = destdir / "raw"
rawdir.mkdir(parents=True)
with (rawdir / "mirrors.lst").open("w") as f:
wr = csv.writer(f, dialect="excel-tab")
wr = csv.writer(f, dialect=CsvDialect)
wr.writerows([[m["region"], m["base_url"], m["location"], m["tier"]] for m in data if m["enabled"]])


Expand Down

0 comments on commit 35b1eb0

Please sign in to comment.