File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616zoomeye_dir = os .path .expanduser (config .ZOOMEYE_CONFIG_PATH )
1717
1818
19- def key_init (key ):
19+ def init_key (key ):
2020 """
2121 initialize through the api key, write the api key to the local configuration file,
2222 theoretically it will never expire unless you remake the api key
@@ -52,7 +52,7 @@ def init(args):
5252 api_key = args .apikey
5353 # use api key init
5454 if api_key :
55- key_init (api_key )
55+ init_key (api_key )
5656 return
5757 # invalid parameter
5858 show .printf ("input parameter error" , color = "red" )
Original file line number Diff line number Diff line change 1616zoomeye_dir = os .path .expanduser (config .ZOOMEYE_CONFIG_PATH )
1717
1818
19+
20+
1921def get_api_key (path ) -> str :
2022 """
2123 obtain api key from local configuration when querying data
@@ -48,6 +50,7 @@ def get_jwt_token(path) -> str:
4850 if not os .path .exists (key_file ):
4951 raise FileNotFoundError ("not found access token config" )
5052
53+
5154 # determine whether the permission of the configuration file is read-only,
5255 # if not, set it to read-only
5356 if not oct (os .stat (key_file ).st_mode ).endswith ("600" ):
You can’t perform that action at this time.
0 commit comments