6 def removeComments(self
,data
):
11 for line
in data
.split("\n"):
12 docstring_end
= ("#docstring_end" in line
)
13 if "#docstring_begin" in line
:
14 ret
+= "//DOCSTRING_PLACEHOLDER\n"
17 if(in_docstring
==False):
20 if(not docstring_end
): docstring
+= line
+ "\n"
23 self
.docstrings
+= [docstring
]
26 def insertDocstrings(self
,data
):
29 for line
in data
.split("\n"):
30 if("//DOCSTRING_PLACEHOLDER" in line
):
32 ret
+= self
.docstrings
[docstring_counter
]
35 docstring_counter
+= 1
37 ret
+= "#"+line
+ "\n"