Skip to content

Commit

Permalink
Infra: Build JSON from dict, with PEP number as key, instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 30, 2022
1 parent 089826a commit 5f88ed5
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@


def create_pep_json(peps: list[parser.PEP]) -> str:
pep_list = [
{
"number": pep.number,
pep_dict = {
pep.number: {
"title": pep.title,
"authors": ", ".join(pep.authors.nick for pep.authors in pep.authors),
"discussions_to": pep.discussions_to,
Expand All @@ -50,8 +49,8 @@ def create_pep_json(peps: list[parser.PEP]) -> str:
"url": f"https://peps.python.org/pep-{pep.number:0>4}/",
}
for pep in sorted(peps)
]
return json.dumps(pep_list, indent=0)
}
return json.dumps(pep_dict, indent=1)


def create_pep_zero(app: Sphinx, env: BuildEnvironment, docnames: list[str]) -> None:
Expand Down

0 comments on commit 5f88ed5

Please sign in to comment.