Skip to content

Commit 846157d

Browse files
committed
cleanup
1 parent 721f586 commit 846157d

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

leetcode/models/graphql_problemset_question_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _execute(self, args):
113113
"""
114114

115115
self.__parse_args(args)
116-
self.data = self.fetch_data()
116+
self.data = self.fetch_data(self.params)
117117
self.show(self.data)
118118

119119
def show(self) -> None:

leetcode/models/graphql_user_problems_solved.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def _execute(self, args) -> None:
8686
raise Exception(self.data['errors'][0]['message'])
8787
self.data = QueryResult.from_dict(self.data['data'])
8888
self.show()
89-
self.recent_submissions()
9089
except Exception as e:
9190
console.print(f"{e.__class__.__name__}: {e}", style=ALERT)
9291

@@ -102,7 +101,7 @@ def show_stats(self) -> None:
102101
for submission in subm:
103102
submit_counts.append(submission.count)
104103

105-
table = LeetTable(title=self.username + "'s Leetcode Stats")
104+
table = LeetTable(title=f"{self.username}'s Leetcode Stats")
106105
table.add_column('Difficulty')
107106
table.add_column('Question Count')
108107
table.add_column('Beaten Stats (%)')
@@ -180,8 +179,8 @@ def __parse_args(self, args):
180179
if getattr(args, 'username'):
181180
self.params['username'] = getattr(args, 'username')
182181
else:
183-
username = self.config.user_config.get('username')
184-
if username:
182+
self.username = self.config.user_config.get('username')
183+
if self.username:
185184
self.params['username'] = self.config.user_config.get('username')
186185
else:
187186
console.print("Username neither provided nor configured. Head to --help.", style=ALERT)
@@ -222,10 +221,10 @@ def params(self, params: Dict) -> None:
222221
self._params = params
223222
self.data_fetched = False
224223

225-
if __name__ == '__main__':
226-
stats = UserProblemsSolved()
227-
stats.fetch_data('skygragon')
228-
stats.show()
224+
# if __name__ == '__main__':
225+
# stats = UserProblemsSolved()
226+
# stats.fetch_data('skygragon')
227+
# stats.show()
229228

230-
stats.fetch_data('coderbeep')
231-
stats.show()
229+
# stats.fetch_data('coderbeep')
230+
# stats.show()

leetcode/models/submit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def parse_args(self, args):
4040
# check if such slug exists
4141
ProblemInfo.lookup_slug(self.title_slug)
4242

43-
def execute(self, args):
43+
def _execute(self, args):
4444
try:
4545
with Loader('Uploading submission...', ''):
4646
self.parse_args(args)

0 commit comments

Comments
 (0)