Fix path issue, since api dir is different from internal

This commit is contained in:
WQY\qiong
2022-11-24 19:43:41 +08:00
parent c314eaed6d
commit 3ec966d491

View File

@@ -19,7 +19,7 @@ class Output:
def __init__(self, path: str) -> None:
self._path = path
self._lib = ctypes.CDLL(os.path.join(os.getcwd(), 'epanet-output.dll'))
self._lib = ctypes.CDLL(os.path.join(os.getcwd(), 'epanet', 'epanet-output.dll'))
self._handle = ctypes.c_void_p()
self._check(self._lib.ENR_init(ctypes.byref(self._handle)))
@@ -166,7 +166,7 @@ def run_project(name: str) -> str:
if not project.have_project(name):
raise Exception(f'Not found project [{name}]')
dir = os.path.dirname(os.getcwd())
dir = os.path.abspath(os.getcwd())
db_inp = os.path.join(os.path.join(dir, 'db_inp'), name + '.db.inp')
parser.dump_inp(name, db_inp)
@@ -187,7 +187,7 @@ def run_project(name: str) -> str:
def run_inp(name: str) -> str:
dir = os.path.dirname(os.getcwd())
dir = os.path.abspath(os.getcwd())
exe = os.path.join(os.path.join(dir, 'epanet'), 'runepanet.exe')
inp = os.path.join(os.path.join(dir, 'inp'), name + '.inp')