Commit 9e8f733f by sikang

bug fix

parent 6e00ebba
......@@ -13,20 +13,20 @@ def close_sdk(path, sdk):
with open(path, "w", encoding="utf-8") as f_w:
is_sdk_code = False
for line in lines:
if "//SDK-"+sdk+"-END" in line or "<!--SDK-"+sdk+"-END-->" in line:
is_sdk_code = False
java_mark ="//SDK-" + sdk + "-CODE ->";
xml_mark ="<!--SDK-" + sdk + "-CODE//";
if path.endswith(".java") and is_sdk_code and java_mark not in line:
line = java_mark + line
if path.endswith(".xml") and is_sdk_code and xml_mark not in line:
line = xml_mark + line.replace("\n","-->\n")
line = xml_mark + line.replace("\n","//-->\n")
if "//SDK-"+sdk+"-START" in line or "<--SDK-"+sdk+"-START-->" in line:
if "//SDK-"+sdk+"-START" in line or "<!--SDK-"+sdk+"-START-->" in line:
is_sdk_code = True
if "//SDK-"+sdk+"-END" in line or "<--SDK-"+sdk+"-START-->" in line:
is_sdk_code = False
f_w.write(line)
return
......@@ -42,7 +42,7 @@ def open_sdk(path, sdk):
if code_mark in line:
line = line.replace(code_mark,"")
if xml_mark in line:
line = line.replace(xml_mark,"").replace("-->","")
line = line.replace(xml_mark,"").replace("//-->","")
f_w.write(line)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment