1
0
mirror of synced 2024-11-27 22:40:49 +01:00

main.py: Use more reliable method of fetching filename

The old method failed for files with no file extension.
This commit is contained in:
Viv 2023-06-03 11:04:12 -04:00
parent b2353df58b
commit 77aa9598a0

View File

@ -1,4 +1,5 @@
import argparse
import os
from tja2fumen.parsers import readFumen, parseTJA
from tja2fumen.writers import writeFumen
@ -56,6 +57,6 @@ if __name__ == "__main__":
fumen, convertedTJAs = main(fnameTJA=fnameTJA)
for course, song in convertedTJAs.items():
outputName = ".".join(fnameTJA.split('.')[0:-1]) + f"_{COURSE_IDS[course]}.bin"
outputName = os.path.splitext(fnameTJA)[0] + f"_{COURSE_IDS[course]}.bin"
outputFile = open(outputName, "wb")
writeFumen(outputFile, song)