-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakebat.py
29 lines (26 loc) · 852 Bytes
/
makebat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python
##
# This script generates a simple shell script to run
# soardoc. It must be run from the directory it's in!
#
import os
exeName = os.sys.executable
curDir = os.getcwd()
outFileName = ''
if os.sys.platform == 'win32':
outFileName = 'soardoc.bat'
f = open(outFileName, 'w')
f.write('echo off\n')
f.write('set PYTHON_EXE="%s"\n' % exeName)
f.write('set SOARDOC_EXE="%s\\src\\soardoc.py"\n' % curDir)
f.write('%PYTHON_EXE% %SOARDOC_EXE% %*\n')
else:
outFileName = 'soardoc'
f = open(outFileName, 'w')
f.write('#!/bin/sh\n')
f.write('PYTHON_EXE="%s"\n' % exeName)
f.write('SOARDOC_EXE="%s/src/soardoc.py"\n' % curDir)
f.write('$PYTHON_EXE $SOARDOC_EXE $*\n')
os.chmod(outFileName, 0755)
print 'Created shell script %s.' % outFileName
print 'Make sure that "%s" is on your system path.' % curDir