Skip to content

Commit 73782d2

Browse files
authored
Merge pull request #98 from WuZhaominn/master
update file.py
2 parents 13899eb + 0536d6a commit 73782d2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

zoomeye/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
zoomeye_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")

zoomeye/file.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
zoomeye_dir = os.path.expanduser(config.ZOOMEYE_CONFIG_PATH)
1717

1818

19+
20+
1921
def 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"):

0 commit comments

Comments
 (0)