esacpe special characters
This commit is contained in:
parent
0a21799e60
commit
68e44e534b
@ -1,4 +1,4 @@
|
||||
#!/bin/python
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
from os import linesep
|
||||
|
||||
@ -86,20 +86,23 @@ with open(coldstore_txt, "w") as f:
|
||||
for score in recordsList:
|
||||
f.write(score + linesep)
|
||||
|
||||
luaA = """local ParseScore = lb_parse_score
|
||||
local AddColdStore = lb_add_coldstore_record
|
||||
local records = {
|
||||
luaA = """do
|
||||
local AddColdStore = lb_add_coldstore_record_string
|
||||
local records = {
|
||||
"""
|
||||
luaB = """}
|
||||
for _, str in ipairs(records) do
|
||||
AddColdStore(ParseScore(str))
|
||||
luaB = """ }
|
||||
for _, str in ipairs(records) do
|
||||
AddColdStore(str)
|
||||
end
|
||||
end
|
||||
"""
|
||||
# pack the records.lua file
|
||||
with open(records_lua, "w") as f:
|
||||
f.write(luaA)
|
||||
for score in recordsList:
|
||||
f.write("\"{}\",{}".format(score, linesep))
|
||||
score = score.replace("\\", "\\\\")
|
||||
score = score.replace("\"", "\\\"")
|
||||
f.write("\t\t\"{}\",{}".format(score, linesep))
|
||||
f.write(luaB)
|
||||
|
||||
# truncate and rewrite rejected scores to leaderboard.txt
|
||||
|
Loading…
x
Reference in New Issue
Block a user