Skip to content

Commit 77e2d7b

Browse files
committed
tweaks
1 parent 35896c2 commit 77e2d7b

File tree

5 files changed

+50
-8
lines changed

5 files changed

+50
-8
lines changed

leetcode/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def __init__(self, session_id: str = ''):
9292
self._cookies: dict = {'csrftoken': self._csrf_cookie,
9393
'LEETCODE_SESSION': self.session_id}
9494
if not Configuration.session_checked:
95-
self.check_session_validity()
95+
self.__check_session_validity()
9696

97-
def check_session_validity(self):
97+
def __check_session_validity(self):
9898
QUERY = """ query
9999
{
100100
user {

leetcode/content_markdown.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66

77
# TODO: handle images
8-
# TODO: handle links
98
""" Turns the HTML code of the LeetCode question to sections. Then each section is
109
altered to Markdown and later into the Rich Panel.
1110

leetcode/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
# the file can be generated when the user displsays the question
99

10-
# TODO: handle the wrong cases in the args parser
1110
# TODO: pipes support
1211
# TODO: add a command to open the question in editor
1312
# TODO: add a command to show the solution in the terminal
@@ -50,6 +49,7 @@ def main():
5049
problem_parser.set_defaults(func=ProblemInfo)
5150
problem_parser.add_argument('id', type=positive_integer, help='Problem ID of the problem')
5251
problem_parser.add_argument('-b', '--browser', action='store_true', help='Open the page in browser.')
52+
problem_parser.add_argument('-f', '--file', action='store_true', help='Create a file with the problem content.')
5353

5454
today_problem_parser = subparsers.add_parser('today', help="Display today's problem.")
5555
today_problem_parser.set_defaults(func=QuestionOfToday)
@@ -76,7 +76,7 @@ def main():
7676
else:
7777
print("Unknown command. Use 'leet --help' for available commands.")
7878

79-
79+
8080
if __name__ == '__main__':
8181
if check_session_validity():
8282
main()

leetcode/queries.graphql

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,50 @@ query GetQuestionDetail($titleSlug: String!) {
246246
envInfo
247247
__typename
248248
}
249+
}
250+
251+
query consolePanelConfig($titleSlug: String!) {
252+
question(titleSlug: $titleSlug) {
253+
questionId
254+
questionFrontendId
255+
questionTitle
256+
enableDebugger
257+
enableRunCode
258+
enableSubmit
259+
enableTestMode
260+
exampleTestcaseList
261+
metaData
262+
}
263+
}
264+
265+
266+
query recentAcSubmissions($username: String!, $limit: Int!) {
267+
recentAcSubmissionList(username: $username, limit: $limit) {
268+
id
269+
title
270+
titleSlug
271+
timestamp
272+
}
273+
}
274+
275+
query GetQuestionId($titleSlug: String!) {
276+
question(titleSlug: $titleSlug) {
277+
questionId
278+
}
279+
}
280+
281+
query IntrospectionQuery {
282+
__type(name: "Query") {
283+
name
284+
fields {
285+
name
286+
args {
287+
name
288+
type {
289+
name
290+
kind
291+
}
292+
}
293+
}
294+
}
249295
}

solution.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)