More tweaks

This commit is contained in:
Bruno Alla 2020-08-10 17:46:34 +01:00
parent c57439e522
commit ea8cfd55a4
2 changed files with 8 additions and 8 deletions

View File

@ -988,4 +988,4 @@
"github_login": "mapx",
"twitter_username": ""
}
]
]

View File

@ -122,18 +122,18 @@ class ContributorsJSONFile:
self.content.extend(contributor_data)
def save(self):
self.file_path.write_text(json.dumps(self.content, indent=2))
text_content = json.dumps(self.content, indent=2, ensure_ascii=False)
self.file_path.write_text(text_content)
def write_md_file(contributors):
template = Template(CONTRIBUTORS_TEMPLATE, autoescape=True)
core_contributors = [
c for c in contributors if c.get("is_core", False)
]
other_contributors = sorted(
c for c in contributors if not c.get("is_core", False)
core_contributors = [c for c in contributors if c.get("is_core", False)]
other_contributors = (c for c in contributors if not c.get("is_core", False))
other_contributors = sorted(other_contributors, key=lambda c: c["name"])
content = template.render(
core_contributors=core_contributors, other_contributors=other_contributors
)
content = template.render(core_contributors=core_contributors, other_contributors=other_contributors)
file_path = ROOT / "CONTRIBUTORS.md"
file_path.write_text(content)