File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
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
+
14
16
with open ("/etc/config.json" , encoding = "utf-8" ) as jsonfile :
15
17
config = json .load (jsonfile )
16
18
17
- with open ("assets/graphql_query.txt" , encoding = "utf-8" ) as queryfile :
19
+ with open (base_dir / "assets/graphql_query.txt" , encoding = "utf-8" ) as queryfile :
18
20
query_param = {"query" : queryfile .read ()}
19
21
20
22
resp = requests .post (
27
29
)
28
30
29
31
json_resp = json .loads (resp .content )["data" ]["user" ]
30
- base_dir = pathlib .Path (sys .argv [1 ])
31
32
resp_dir = base_dir / "assets/contrib/"
32
33
card_dir = base_dir / "flask_app/static/img/gh_cards/"
33
34
resp_dir .mkdir (exist_ok = True )
34
35
card_dir .mkdir (exist_ok = True )
35
36
36
- with open (str ( resp_dir / "recent.json" ) , mode = "w" , encoding = "utf-8" ) as contribfile :
37
+ with open (resp_dir / "recent.json" , mode = "w" , encoding = "utf-8" ) as contribfile :
37
38
json .dump (json_resp , contribfile )
38
39
39
40
You can’t perform that action at this time.
0 commit comments