mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-05-30 11:13:08 +03:00
More tweaks
This commit is contained in:
parent
c57439e522
commit
ea8cfd55a4
|
@ -122,18 +122,18 @@ class ContributorsJSONFile:
|
||||||
self.content.extend(contributor_data)
|
self.content.extend(contributor_data)
|
||||||
|
|
||||||
def save(self):
|
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):
|
def write_md_file(contributors):
|
||||||
template = Template(CONTRIBUTORS_TEMPLATE, autoescape=True)
|
template = Template(CONTRIBUTORS_TEMPLATE, autoescape=True)
|
||||||
core_contributors = [
|
core_contributors = [c for c in contributors if c.get("is_core", False)]
|
||||||
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"])
|
||||||
other_contributors = sorted(
|
content = template.render(
|
||||||
c for c in contributors if not c.get("is_core", False)
|
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 = ROOT / "CONTRIBUTORS.md"
|
||||||
file_path.write_text(content)
|
file_path.write_text(content)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user