use working directory
This commit is contained in:
parent
fe6f5b2a8f
commit
8177786ddf
|
@ -100,8 +100,12 @@ if __name__ == '__main__':
|
||||||
app_name = args.APPNAME
|
app_name = args.APPNAME
|
||||||
header = 'msodbcsql.h'
|
header = 'msodbcsql.h'
|
||||||
|
|
||||||
|
cwd = os.getcwd()
|
||||||
|
|
||||||
# make sure all required source and header files are present
|
# make sure all required source and header files are present
|
||||||
work_dir = os.path.dirname(os.path.realpath(__file__))
|
work_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
os.chdir(work_dir)
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(work_dir, header)):
|
if not os.path.exists(os.path.join(work_dir, header)):
|
||||||
print('Error: {0} not found!'.format(header))
|
print('Error: {0} not found!'.format(header))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -114,4 +118,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
compile_KSP(ksp_name)
|
compile_KSP(ksp_name)
|
||||||
configure_KSP(app_name)
|
configure_KSP(app_name)
|
||||||
|
|
||||||
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,12 @@ if __name__ == '__main__':
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
app_name = 'ksp_app'
|
app_name = 'ksp_app'
|
||||||
|
cwd = os.getcwd()
|
||||||
|
|
||||||
# first check if the ksp app is present
|
# first check if the ksp app is present
|
||||||
work_dir = os.path.dirname(os.path.realpath(__file__))
|
work_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
os.chdir(work_dir)
|
||||||
|
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
path = os.path.join(work_dir, app_name + '.exe')
|
path = os.path.join(work_dir, app_name + '.exe')
|
||||||
executable = app_name
|
executable = app_name
|
||||||
|
@ -50,3 +53,5 @@ if __name__ == '__main__':
|
||||||
os.system('{0} 1 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD))
|
os.system('{0} 1 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD))
|
||||||
else:
|
else:
|
||||||
os.system('{0} 0 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD))
|
os.system('{0} 0 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD))
|
||||||
|
|
||||||
|
os.chdir(cwd)
|
||||||
|
|
Loading…
Reference in a new issue