mirror of
https://github.com/martinhaye/a2render.git
synced 2024-06-10 20:29:36 +00:00
33 lines
948 B
Python
33 lines
948 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
# This wrapper script takes everything in the 'files' directory and puts it
|
||
|
# into image file 'platform/LL.2mg'.
|
||
|
|
||
|
import os, re, subprocess, sys
|
||
|
from os.path import join as pjoin
|
||
|
|
||
|
# No matter where we run from, use the right directories.
|
||
|
binDir = os.path.dirname(sys.argv[0])
|
||
|
if not os.path.isabs(binDir):
|
||
|
binDir = pjoin(os.getenv("PWD", os.getcwd()), binDir)
|
||
|
binDir = re.sub("\/?\.?$", "", binDir)
|
||
|
mainDir = os.path.dirname(binDir) # binDir/..
|
||
|
|
||
|
|
||
|
################################################################################
|
||
|
def main():
|
||
|
""" Command-line driver. """
|
||
|
|
||
|
os.chdir(mainDir)
|
||
|
javaCmd = ['java',
|
||
|
'-cp', 'a2copy/lib/ac.jar:a2copy/a2copy.jar',
|
||
|
'A2copy',
|
||
|
'-create', 'platform/LL.2mg', 'files/']
|
||
|
proc = subprocess.Popen(javaCmd)
|
||
|
proc.communicate()
|
||
|
sys.exit(proc.returncode)
|
||
|
|
||
|
|
||
|
################################################################################
|
||
|
main()
|