File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4
4
# "gitpython",
5
5
# "potodo",
6
6
# "jinja2",
7
- # "requests",
8
7
# "docutils",
9
8
# "sphinx",
10
9
# "python-docs-theme",
19
18
from datetime import datetime , timezone
20
19
from json import loads
21
20
from pathlib import Path
21
+ from sys import argv
22
22
from tempfile import TemporaryDirectory
23
23
24
24
import dacite
25
25
from git import Repo
26
26
from jinja2 import Template
27
+ from urllib3 import request
27
28
28
29
import build_warnings
29
30
from completion import branches_from_devguide
@@ -77,10 +78,13 @@ def get_language_repo_and_completion(
77
78
logging .basicConfig (level = logging .INFO )
78
79
logging .info (f'starting at { generation_time } ' )
79
80
template = Template (Path ('metadata.html.jinja' ).read_text ())
81
+ if (index_path := Path ('index.json' )).exists ():
82
+ index_json = loads (Path ('index.json' ).read_text ())
83
+ else :
84
+ index_json = request ('GET' , argv [1 ]).json ()
80
85
81
86
completion_progress = [
82
- dacite .from_dict (LanguageProjectData , project )
83
- for project in loads (Path ('index.json' ).read_text ())
87
+ dacite .from_dict (LanguageProjectData , project ) for project in index_json
84
88
]
85
89
86
90
output = template .render (
You can’t perform that action at this time.
0 commit comments