File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def read_token():
29
29
print (f"{ Fore .RED } ✕{ Fore .RESET } Error reading Token:\n { Fore .RED } { e } { Fore .RESET } " )
30
30
return "error"
31
31
32
- def set_token (token , yes = False ):
32
+ def set_token (token : str , yes = False ):
33
33
# 凭据 github-access-token.glm
34
34
# == 移除 ==
35
35
if token == "remove" :
@@ -49,7 +49,7 @@ def set_token(token, yes=False):
49
49
50
50
# == 添加 ==
51
51
# --- Token 检查 ---
52
- if not (token .startswith ("ghp_" ) and token .startwith ("github_pat_" ) and yes ):
52
+ if not (token .startswith ("ghp_" ) or token .startswith ("github_pat_" ) or yes ):
53
53
print (f"{ Fore .YELLOW } ⚠{ Fore .RESET } Please check whether the Token is correct." )
54
54
try :
55
55
input (f"Press { Fore .BLUE } Enter{ Fore .RESET } to confirm, press { Fore .BLUE } Ctrl + C{ Fore .RESET } to cancel..." )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def read_token():
29
29
print (f"{ Fore .RED } ✕{ Fore .RESET } 读取Token时出错:\n { Fore .RED } { e } { Fore .RESET } " )
30
30
return "error"
31
31
32
- def set_token (token , yes = False ):
32
+ def set_token (token : str , yes = False ):
33
33
# 凭据 github-access-token.glm
34
34
# == 移除 ==
35
35
if token == "remove" :
@@ -49,7 +49,7 @@ def set_token(token, yes=False):
49
49
50
50
# == 添加 ==
51
51
# --- Token 检查 ---
52
- if not (token .startswith ("ghp_" ) and token .startwith ("github_pat_" ) and yes ):
52
+ if not (token .startswith ("ghp_" ) or token .startswith ("github_pat_" ) or yes ):
53
53
print (f"{ Fore .YELLOW } ⚠{ Fore .RESET } 请确认Token是否正确" )
54
54
try :
55
55
input (f"按{ Fore .BLUE } Enter{ Fore .RESET } 键确认,按{ Fore .BLUE } Ctrl + C{ Fore .RESET } 键取消..." )
You can’t perform that action at this time.
0 commit comments