File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11
11
12
12
URL = "https://api.github.com/graphql"
13
13
14
+ base_dir = pathlib .Path (sys .argv [1 ])
15
+
16
+ resp_dir = base_dir / "assets/contrib/"
17
+ card_dir = base_dir / "flask_app/static/img/gh_cards/"
18
+ resp_dir .mkdir (exist_ok = True )
19
+ card_dir .mkdir (exist_ok = True )
20
+
14
21
with open ("/etc/config.json" , encoding = "utf-8" ) as jsonfile :
15
22
config = json .load (jsonfile )
16
23
17
- with open ("assets/graphql_query.txt" , encoding = "utf-8" ) as queryfile :
24
+ with open (base_dir / "assets/graphql_query.txt" , encoding = "utf-8" ) as queryfile :
18
25
query_param = {"query" : queryfile .read ()}
19
26
20
27
resp = requests .post (
27
34
)
28
35
29
36
json_resp = json .loads (resp .content )["data" ]["user" ]
30
- base_dir = pathlib .Path (sys .argv [1 ])
31
- resp_dir = base_dir / "assets/contrib/"
32
- card_dir = base_dir / "flask_app/static/img/gh_cards/"
33
- resp_dir .mkdir (exist_ok = True )
34
- card_dir .mkdir (exist_ok = True )
35
37
36
- with open (str ( resp_dir / "recent.json" ) , mode = "w" , encoding = "utf-8" ) as contribfile :
38
+ with open (resp_dir / "recent.json" , mode = "w" , encoding = "utf-8" ) as contribfile :
37
39
json .dump (json_resp , contribfile )
38
40
39
41
You can’t perform that action at this time.
0 commit comments