@@ -24,17 +24,17 @@ def get_api_key(path) -> str:
2424 :param path:
2525 :return:
2626 """
27- key_file = zoomeye_dir + "/apikey"
27+ key_fl = zoomeye_dir + "/apikey"
2828 # api key config does not exits
2929 # raise FileNotFoundError
30- if not os .path .exists (key_file ):
30+ if not os .path .exists (key_fl ):
3131 raise FileNotFoundError ("not found api key config" )
3232 # determine whether the permission of the configuration file is read-only,
3333 # if not, set it to read-only
34- if not oct (os .stat (key_file ).st_mode ).endswith ("600" ):
35- os .chmod (key_file , 0o600 )
34+ if not oct (os .stat (key_fl ).st_mode ).endswith ("600" ):
35+ os .chmod (key_fl , 0o600 )
3636 # return read file content
37- with open (key_file , 'r' ) as f :
37+ with open (key_fl , 'r' ) as f :
3838 return f .read ().strip ()
3939
4040
@@ -44,19 +44,19 @@ def get_jwt_token(path) -> str:
4444 :param path:
4545 :return:
4646 """
47- key_file = zoomeye_dir + "/jwt"
47+ key_fl = zoomeye_dir + "/jwt"
4848 # json web token does not exits
4949 # raise FileNotFoundError
50- if not os .path .exists (key_file ):
50+ if not os .path .exists (key_fl ):
5151 raise FileNotFoundError ("not found access token config" )
5252
5353
5454 # determine whether the permission of the configuration file is read-only,
5555 # if not, set it to read-only
56- if not oct (os .stat (key_file ).st_mode ).endswith ("600" ):
57- os .chmod (key_file , 0o600 )
56+ if not oct (os .stat (key_fl ).st_mode ).endswith ("600" ):
57+ os .chmod (key_fl , 0o600 )
5858 # return read config content
59- with open (key_file , 'r' ) as f :
59+ with open (key_fl , 'r' ) as f :
6060 return f .read ().strip ()
6161
6262
0 commit comments