11from config .settings import Config
2-
3- from leetcode .parser import (
4- parse_submissions ,
5- parse_submission_detail ,
6- )
7-
8- from leetcode .queries import (
9- PROFILE_QUERY ,
10- RECENT_SUBMISSIONS_QUERY ,
11- SUBMISSION_DETAILS_QUERY ,
12- )
2+ from leetcode .parser import parse_submission_detail , parse_submissions
3+ from leetcode .queries import (PROFILE_QUERY , RECENT_SUBMISSIONS_QUERY ,
4+ SUBMISSION_DETAILS_QUERY )
135
146
157class LeetCodeAPI :
@@ -21,9 +13,7 @@ def get_profile(self):
2113
2214 response = self .client .post (
2315 PROFILE_QUERY ,
24- {
25- "username" : Config .LEETCODE_USERNAME
26- },
16+ {"username" : Config .LEETCODE_USERNAME },
2717 )
2818
2919 if "errors" in response :
@@ -45,18 +35,14 @@ def get_recent_submissions(self, limit=15):
4535 if "errors" in response :
4636 raise Exception (response ["errors" ])
4737
48- return parse_submissions (
49- response ["data" ]["recentAcSubmissionList" ]
50- )
38+ return parse_submissions (response ["data" ]["recentAcSubmissionList" ])
5139
5240 def get_submission_detail (self , submission_id ):
5341 """Fetch detailed information about a submission."""
5442
5543 response = self .client .post (
5644 SUBMISSION_DETAILS_QUERY ,
57- {
58- "submissionId" : int (submission_id )
59- },
45+ {"submissionId" : int (submission_id )},
6046 )
6147
6248 if "errors" in response :
@@ -65,4 +51,4 @@ def get_submission_detail(self, submission_id):
6551 return parse_submission_detail (
6652 submission_id ,
6753 response ["data" ]["submissionDetails" ],
68- )
54+ )
0 commit comments