py3: src/Tools: python3 diff, 1. part

issue 0000995
This commit is contained in:
looooo
2017-05-30 16:13:55 +02:00
committed by wmayer
parent 4b042536f8
commit 11dcd18e0f
7 changed files with 104 additions and 69 deletions

View File

@@ -25,11 +25,11 @@ out.write("const char " + fn[:-3] + "[] =")
for line in lines:
# remove new line
line2 = string.rstrip(line)
line2 = line.rstrip()
# replace special chars
line2 = string.replace(line2,'\\','\\\\')
line2 = string.replace(line2,'\"','\\\"')
line2 = string.replace(line2,"\'","\\\'")
line2 = line2.replace('\\','\\\\')
line2 = line2.replace('\"','\\\"')
line2 = line2.replace("\'","\\\'")
# output