|
23 | 23 | generation_time = datetime.now(timezone.utc) |
24 | 24 |
|
25 | 25 | with TemporaryDirectory() as clones_dir: |
| 26 | + Repo.clone_from(f'https://github.com/python/devguide.git', devguide_dir := Path(clones_dir, 'devguide'), depth=1) |
| 27 | + latest_branch = branches_from_devguide(devguide_dir)[0] |
26 | 28 | Repo.clone_from( |
27 | | - f'https://github.com/python/cpython.git', Path(clones_dir, 'cpython'), depth=1, branch=branches_from_devguide()[0] |
| 29 | + f'https://github.com/python/cpython.git', Path(clones_dir, 'cpython'), depth=1, branch=latest_branch |
28 | 30 | ) |
29 | 31 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'venv'], check=True) |
30 | 32 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'gettext'], check=True) |
31 | | - for language, repo in repositories.get_languages_and_repos(): |
| 33 | + for language, repo in repositories.get_languages_and_repos(devguide_dir): |
32 | 34 | if repo: |
33 | 35 | completion_number = get_completion(clones_dir, repo) |
34 | 36 | visitors_number = visitors.get_number_of_visitors(language) |
35 | 37 | else: |
36 | | - completion_number, visitors_number = 0., 0 |
| 38 | + completion_number, visitors_number = 0.0, 0 |
37 | 39 | completion_progress.append((language, repo, completion_number, visitors_number)) |
38 | 40 | print(completion_progress[-1]) |
39 | 41 |
|
40 | | -template = Template(""" |
| 42 | +template = Template( |
| 43 | + """ |
41 | 44 | <html lang="en"> |
42 | 45 | <head> |
43 | 46 | <title>Python Docs Translation Dashboard</title> |
|
81 | 84 | <p>Last updated at {{ generation_time.strftime('%A, %d %B %Y, %X %Z') }}.</p> |
82 | 85 | </body> |
83 | 86 | </html> |
84 | | -""") |
| 87 | +""" |
| 88 | +) |
85 | 89 |
|
86 | 90 | output = template.render(completion_progress=completion_progress, generation_time=generation_time) |
87 | 91 |
|
|
0 commit comments