14
14
import glob
15
15
16
16
17
- def non_lib_configuration (): # had to change name becasue of python-leetcode lib
17
+ def non_lib_configuration (): # had to change name because of python-leetcode lib
18
18
leetcode_session , csrf_token = load_credentials_from_config ()
19
19
if not leetcode_session or not csrf_token :
20
20
leetcode_session = click .prompt ("Enter your LeetCode session" , type = str )
@@ -101,7 +101,7 @@ def print_test_result(test_data, data_input):
101
101
print ("" .center (40 , "=" ))
102
102
103
103
104
- def print_submission_result (submission ): # used python-leetocde library
104
+ def print_submission_result (submission ): # used python-leetcode library
105
105
run_success = submission .get ("run_success" )
106
106
status_msg = submission .get ("status_msg" )
107
107
if run_success and status_msg == "Accepted" :
@@ -166,7 +166,7 @@ def print_submission_result(submission): # used python-leetocde library
166
166
167
167
def initialize_leetcode_api_instance (
168
168
leetcode_session , leetcode_csrf_token
169
- ): # used python-leetocde library
169
+ ): # used python-leetcode library
170
170
configuration = leetcode .Configuration ()
171
171
csrf_token = leetcode_csrf_token
172
172
configuration .api_key ["x-csrftoken" ] = csrf_token
@@ -175,7 +175,7 @@ def initialize_leetcode_api_instance(
175
175
configuration .api_key ["Referer" ] = "https://.com"
176
176
configuration .debug = False
177
177
178
- api_instance = .DefaultApi (.ApiClient (configuration ))
178
+ api_instance = leetcode .DefaultApi (leetcode .ApiClient (configuration ))
179
179
return api_instance
180
180
181
181
@@ -200,7 +200,7 @@ def interpret_solution(title_slug, payload, api_instance):
200
200
# --submit
201
201
def submit_solution (
202
202
api_instance , title_slug , code , question_id , lang_name
203
- ): # used python-leetocde library
203
+ ): # used python-leetcode library
204
204
submission = leetcode .Submission (
205
205
judge_type = "large" ,
206
206
typed_code = code ,
@@ -655,7 +655,7 @@ def replace_files():
655
655
@click .option (
656
656
"--help" , "-h" , is_flag = True , default = False , help = "Show usage information"
657
657
)
658
- def main (config , user_lang , question , solve , test , submit , help , lib ):
658
+ def main (config , user_lang , question , solve , test , submit , help_cmd , lib ):
659
659
if lib :
660
660
replace_files ()
661
661
exit ()
@@ -693,7 +693,7 @@ def main(config, user_lang, question, solve, test, submit, help, lib):
693
693
leetcode_session , csrf_token
694
694
)
695
695
process_submit_file (leetcode_api_instance , api_instance , submit )
696
- elif help :
696
+ elif help_cmd :
697
697
print_help_usage ()
698
698
else :
699
699
print (
0 commit comments