2018-02-11 17:41:39 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
fileinfo = []
|
|
|
|
for f in sys.argv[1:]:
|
|
|
|
linelength = 0
|
|
|
|
with open(f) as buffer:
|
|
|
|
lines = buffer.readlines()
|
2018-02-21 21:02:26 +00:00
|
|
|
shortf = f.replace(".txt", "").replace("res/text/", "").upper()
|
2018-02-11 17:41:39 +00:00
|
|
|
newf = "build/text/" + shortf
|
|
|
|
fileinfo.append(shortf + "=Type(04),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(C3)")
|
|
|
|
with open(newf, 'w') as buffer:
|
|
|
|
for l in lines:
|
|
|
|
l = l[:-1]
|
|
|
|
if not l:
|
|
|
|
linelength = 0
|
|
|
|
if l and linelength:
|
|
|
|
l = l + ' '*(linelength-len(l))
|
2018-03-27 19:19:48 +00:00
|
|
|
buffer.write(l + "\r")
|
2018-02-11 17:41:39 +00:00
|
|
|
if l.startswith("[info]"):
|
2018-02-24 20:25:41 +00:00
|
|
|
linelength = 64
|
2018-02-11 17:41:39 +00:00
|
|
|
elif l.startswith("[description]"):
|
|
|
|
linelength = 77
|
|
|
|
with open("build/text/_FileInformation.txt", "w") as infobuff:
|
|
|
|
infobuff.write("\r\n".join(fileinfo))
|