Skip to content

Commit

Permalink
Update epanet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Mar 23, 2024
1 parent 73f4556 commit 1cc5b30
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions epyt/epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12807,7 +12807,7 @@ def __init__(self, version=2.2, msx=False):
libname = f"epanet2"
ops = platform.system().lower()
if ops in ["windows"]:
self.LibEPANET = resource_filename("epyt", os.path.join("libraries", "win", '64bit', f"{libname}2.dll"))
self.LibEPANET = resource_filename("epyt", os.path.join("libraries", "win", f"{libname}.dll"))
elif ops in ["darwin"]:
self.LibEPANET = resource_filename("epyt", os.path.join("libraries", f"mac/lib{libname}.dylib"))
else:
Expand Down Expand Up @@ -15637,8 +15637,7 @@ class epanetmsxapi:
def __init__(self, filename=None):
ops = platform.system().lower()
if ops in ["windows"]:
self.MSXLibEPANET = resource_filename("epyt", os.path.join("libraries", "win", 'epanet2_2', '64bit',
"epanetmsx.dll"))
self.MSXLibEPANET = resource_filename("epyt", os.path.join("libraries", "win", "epanetmsx.dll"))
elif ops in ["darwin"]:
self.MSXLibEPANET = resource_filename("epyt", os.path.join("libraries", "mac", "epanetmsx.dylib"))
else:
Expand All @@ -15647,6 +15646,10 @@ def __init__(self, filename=None):
self.msx_lib = cdll.LoadLibrary(self.MSXLibEPANET)
self.MSXLibEPANETPath = os.path.dirname(self.MSXLibEPANET)

# Error ~ function
self.msx_error = self.msx_lib.MSXgeterror
self.msx_error.argtypes = [c_int, c_char_p, c_int]

# msx opens starts here
if filename is not None:
""" Open .msx file
Expand All @@ -15667,10 +15670,6 @@ def __init__(self, filename=None):
print("MSX file opened successfully.")
# msx open ends here

# Error ~ function
self.msx_error = self.msx_lib.MSXgeterror
self.msx_error.argtypes = [c_int, c_char_p, c_int]

def MSXopen(self, filename):
""" Open .msx file
msx.MSXopen(filename)
Expand Down

0 comments on commit 1cc5b30

Please sign in to comment.