File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def _execute(self, args) -> None:
78
78
self .show ()
79
79
80
80
if self .fileFlag :
81
- self .create_file (self .title_slug )
81
+ self .create_submission_file (self .title_slug )
82
82
83
83
def show (self ) -> None :
84
84
""" Shows the question information and content or opens the question in a browser.
@@ -99,11 +99,18 @@ def show(self) -> None:
99
99
print (question_info_table )
100
100
101
101
@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 '
104
110
question = GetQuestionDetail (title_slug )
105
111
filename = f"{ question .question_id } .{ question .title_slug } .py"
106
112
with open (filename , 'w' ) as file :
113
+ file .write (watermark_info )
107
114
file .write (question .code_snippet )
108
115
console .print (f"File '{ filename } ' has been created." )
109
116
You can’t perform that action at this time.
0 commit comments