|
1 | 1 | # /// script |
| 2 | +# requires-python = ">=3.11" |
2 | 3 | # dependencies = [ |
3 | 4 | # "gitpython", |
4 | 5 | # "potodo", |
|
16 | 17 | from jinja2 import Template |
17 | 18 |
|
18 | 19 | import repositories |
| 20 | +import switcher |
19 | 21 | import visitors |
20 | 22 | from completion import branches_from_devguide, get_completion |
21 | 23 |
|
|
30 | 32 | ) |
31 | 33 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'venv'], check=True) |
32 | 34 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'gettext'], check=True) |
| 35 | + switcher_languages = list(switcher.get_languages()) |
33 | 36 | for language, repo in repositories.get_languages_and_repos(devguide_dir): |
34 | 37 | if repo: |
35 | 38 | completion_number, translators_number = get_completion(clones_dir, repo) |
36 | 39 | visitors_number = visitors.get_number_of_visitors(language) |
37 | 40 | else: |
38 | 41 | completion_number, visitors_number = 0.0, 0 |
39 | | - completion_progress.append((language, repo, completion_number, translators_number, visitors_number)) |
| 42 | + completion_progress.append( |
| 43 | + ( |
| 44 | + language, |
| 45 | + repo, |
| 46 | + completion_number, |
| 47 | + translators_number, |
| 48 | + visitors_number, |
| 49 | + language in switcher_languages, |
| 50 | + ) |
| 51 | + ) |
40 | 52 | print(completion_progress[-1]) |
41 | 53 |
|
42 | 54 | template = Template( |
|
52 | 64 | <thead> |
53 | 65 | <tr> |
54 | 66 | <th>language</th> |
| 67 | + <th>build</th> |
55 | 68 | <th><a href="https://plausible.io/data-policy#how-we-count-unique-users-without-cookies">visitors<a/></th> |
56 | 69 | <th>translators</th> |
57 | 70 | <th>completion</th> |
58 | 71 | </tr> |
59 | 72 | </thead> |
60 | 73 | <tbody> |
61 | | -{% for language, repo, completion, translators, visitors in completion_progress | sort(attribute=2) | reverse %} |
| 74 | +{% for language, repo, completion, translators, visitors, in_switcher in completion_progress | sort(attribute=2) | reverse %} |
62 | 75 | <tr> |
63 | 76 | {% if repo %} |
64 | 77 | <td data-label="language"> |
65 | 78 | <a href="https://github.com/{{ repo }}" target="_blank"> |
66 | 79 | {{ language }} |
67 | 80 | </a> |
| 81 | + </td> |
| 82 | + <td data-label="build"> |
| 83 | + {% if in_switcher %} |
| 84 | + <a href="https://docs.python.org/{{ language }}/">in switcher</a> |
| 85 | + {% else %} |
| 86 | + ✗ |
| 87 | + {% endif %} |
68 | 88 | </td> |
69 | 89 | <td data-label="visitors"> |
70 | 90 | <a href="https://plausible.io/docs.python.org?filters=((contains,page,(/{{ language }}/)))" target="_blank"> |
|
0 commit comments