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:
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
You can’t perform that action at this time.
0 commit comments