Skip to content

Commit 76a65e4

Browse files
StanFromIrelandm-aciek
authored andcommitted
Add changes to meta table
1 parent 844359b commit 76a65e4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get_completion(
7070

7171
change = completion - month_ago_completion
7272

73-
return completion, translators_data, branch or None, change
73+
return completion, translators_data, branch, change
7474

7575

7676
@dataclass(frozen=True)

generate_metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ def get_language_repo_branch_and_completion(
102102
completion_progress = [
103103
dacite.from_dict(LanguageProjectData, project) for project in index_json
104104
]
105+
changes = [project.change for project in completion_progress]
105106

106107
output = template.render(
107108
metadata=zip(completion_progress, get_projects_metadata(completion_progress)),
108109
generation_time=generation_time,
109110
duration=(datetime.now(timezone.utc) - generation_time).seconds,
111+
change=changes,
110112
)
111113

112114
Path('metadata.html').write_text(output)

metadata.html.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<th>branch</th>
1818
<th>build warnings*</th>
1919
<th>lint failures</th>
20+
<th>change this month</th>
2021
</tr>
2122
</thead>
2223
<tbody>
@@ -30,6 +31,9 @@
3031
<td data-label="lint">
3132
{% if project.completion %}<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>{% else %}{{ metadata[1] }}{% endif %}
3233
</td>
34+
<td>
35+
<td data-label="change">{{ "{:.2f}".format(project.completion) }}%</td>
36+
</td>
3337
</tr>
3438
{% endfor %}
3539
</tbody>

0 commit comments

Comments
 (0)