1414import glob
1515
1616
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
1818 leetcode_session , csrf_token = load_credentials_from_config ()
1919 if not leetcode_session or not csrf_token :
2020 leetcode_session = click .prompt ("Enter your LeetCode session" , type = str )
@@ -101,7 +101,7 @@ def print_test_result(test_data, data_input):
101101 print ("" .center (40 , "=" ))
102102
103103
104- def print_submission_result (submission ): # used python-leetocde library
104+ def print_submission_result (submission ): # used python-leetcode library
105105 run_success = submission .get ("run_success" )
106106 status_msg = submission .get ("status_msg" )
107107 if run_success and status_msg == "Accepted" :
@@ -166,7 +166,7 @@ def print_submission_result(submission): # used python-leetocde library
166166
167167def initialize_leetcode_api_instance (
168168 leetcode_session , leetcode_csrf_token
169- ): # used python-leetocde library
169+ ): # used python-leetcode library
170170 configuration = leetcode .Configuration ()
171171 csrf_token = leetcode_csrf_token
172172 configuration .api_key ["x-csrftoken" ] = csrf_token
@@ -175,7 +175,7 @@ def initialize_leetcode_api_instance(
175175 configuration .api_key ["Referer" ] = "https://.com"
176176 configuration .debug = False
177177
178- api_instance = .DefaultApi (.ApiClient (configuration ))
178+ api_instance = leetcode .DefaultApi (leetcode .ApiClient (configuration ))
179179 return api_instance
180180
181181
@@ -200,7 +200,7 @@ def interpret_solution(title_slug, payload, api_instance):
200200# --submit
201201def submit_solution (
202202 api_instance , title_slug , code , question_id , lang_name
203- ): # used python-leetocde library
203+ ): # used python-leetcode library
204204 submission = leetcode .Submission (
205205 judge_type = "large" ,
206206 typed_code = code ,
@@ -655,7 +655,7 @@ def replace_files():
655655@click .option (
656656 "--help" , "-h" , is_flag = True , default = False , help = "Show usage information"
657657)
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 ):
659659 if lib :
660660 replace_files ()
661661 exit ()
@@ -693,7 +693,7 @@ def main(config, user_lang, question, solve, test, submit, help, lib):
693693 leetcode_session , csrf_token
694694 )
695695 process_submit_file (leetcode_api_instance , api_instance , submit )
696- elif help :
696+ elif help_cmd :
697697 print_help_usage ()
698698 else :
699699 print (
0 commit comments