1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-04-26 22:29:23 +03:00
gamebookformat/buildexamplegamebook.py

25 lines
694 B
Python
Executable file

#!/usr/bin/env python
import os
import sys
DEFAULT_OPTIONS = '--no-shuffle --no-default-map'
if __name__ == '__main__':
if len(sys.argv) != 3:
print >> sys.stderr, "usage: %s infile outfile" % sys.argv[0]
sys.exit(1)
infile = sys.argv[1]
outfile = sys.argv[2]
print infile, outfile
optionsfilename = infile + '.options'
options = DEFAULT_OPTIONS
if os.path.exists(optionsfilename):
optionsfile = open(optionsfilename)
options += ' ' + ' '.join(optionsfile.readlines())
optionsfile.close()
command = "python2.7 ./formatgamebook.py %s %s %s" % (
options, infile, outfile)
print command
os.system(command)