mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2025-01-08 13:30:24 +00:00
27 lines
865 B
Python
Executable File
27 lines
865 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
fileinfo = []
|
|
for f in sys.argv[1:]:
|
|
linelength = 0
|
|
with open(f) as buffer:
|
|
lines = buffer.readlines()
|
|
shortf = f.replace(".txt", "").replace("res/text/", "").upper()
|
|
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))
|
|
buffer.write(l + "\r")
|
|
if l.startswith("[info]"):
|
|
linelength = 64
|
|
elif l.startswith("[description]"):
|
|
linelength = 77
|
|
with open("build/text/_FileInformation.txt", "w") as infobuff:
|
|
infobuff.write("\r\n".join(fileinfo))
|