Skip to content

Commit 50d4ea3

Browse files
authored
work with jeff to get linux working (HydrologicEngineeringCenter#17)
1 parent b551908 commit 50d4ea3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

hec_dss_native.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import ctypes
22
from ctypes import c_char, c_double, c_int,byref, create_string_buffer
33
import array
4-
4+
import sys
55

66
class HecDssNative:
77
"""Wrapper for Native method calls to hecdss.dll or libhecdss.so """
88

99
def __init__(self):
10-
self.dll = ctypes.CDLL("hecdss")
10+
if sys.platform == "linux" or sys.platform == "darwin":
11+
self.dll = ctypes.CDLL('./libhecdss.so')
12+
elif sys.platform == "win32":
13+
self.dll = ctypes.CDLL('hecdss')
14+
else:
15+
raise Exception("Unsupported platform")
16+
1117

1218
def hec_dss_open(self,dss_filename):
1319
self.dll.hec_dss_open.argtypes = [ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)]

0 commit comments

Comments
 (0)