Skip to content

Commit 1508df0

Browse files
committed
tweaks
1 parent e33c745 commit 1508df0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

leetcode/models/graphql_question_of_today.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _execute(self, args) -> None:
7878
self.show()
7979

8080
if self.fileFlag:
81-
self.create_file(self.title_slug)
81+
self.create_submission_file(self.title_slug)
8282

8383
def show(self) -> None:
8484
""" Shows the question information and content or opens the question in a browser.
@@ -99,11 +99,18 @@ def show(self) -> None:
9999
print(question_info_table)
100100

101101
@classmethod
102-
def create_file(cls, title_slug: str) -> None:
103-
""" Creates a file with the question content. """
102+
def create_submission_file(cls, title_slug: str) -> None:
103+
""" Creates a file with the question content.
104+
105+
Args:
106+
title_slug (str): The title slug of the question. """
107+
108+
""" Add watermark to the file."""
109+
watermark_info = '# This file was created by pyleetcode-cli software.\n# Do NOT modify the name of the file.\n\n'
104110
question = GetQuestionDetail(title_slug)
105111
filename = f"{question.question_id}.{question.title_slug}.py"
106112
with open(filename, 'w') as file:
113+
file.write(watermark_info)
107114
file.write(question.code_snippet)
108115
console.print(f"File '{filename}' has been created.")
109116

0 commit comments

Comments
 (0)