Read the data files from the same path where the script resides.

This commit is contained in:
Sei Lisa 2015-03-06 20:29:54 +01:00
parent ac9f0c30a5
commit a9179f2779
2 changed files with 9 additions and 2 deletions

View file

@ -23,6 +23,8 @@ from lslopt.lslparse import parser,EParse
from lslopt.lsloutput import outscript
from lslopt.lsloptimizer import optimizer
import sys
import os
import lslopt.lslcommon
def main():
if len(sys.argv) < 2:
@ -129,6 +131,10 @@ Options (+ means active by default, - means inactive by default):
'optsigns','optfloats','constfold','dcr'
))
# If it's good to append the basename to it, it's good to append the
# auxiliary files' names to it.
lslopt.lslcommon.DataPath = __file__[:-len(os.path.basename(__file__))]
if sys.argv[1] == '-O':
if len(sys.argv) < 4:
sys.stderr.write('Command line: Not enough parameters\n')