Skip to content

Commit d56702d

Browse files
committed
Upload the DLL as well as using windows plataform
1 parent 426c44c commit d56702d

17 files changed

+19
-9
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dist: xenial
33
cache: false
44
env:
55
global:
6-
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
6+
- os: windows
77
- SEGFAULT_SIGNALS=all
88
- LANG=en_US.UTF-8
99
matrix:

MANIFEST.in

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ include CONTRIBUTING.rst
1414
include LICENSE
1515
include README.rst
1616
include *.py
17-
recursive-include DDLL *.dll
18-
recursive-include DDLL *.exe
19-
17+
recursive-include src\py_dss_interface\DDLL *.dll
18+
recursive-include src\py_dss_interface\DDLL *.exe
19+
recursive-include tests\py_dss_interface\DDLL *.dll
20+
recursive-include tests\py_dss_interface\DDLL *.exe
2021

2122
include tox.ini .travis.yml .appveyor.yml .readthedocs.yml
2223

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
2525

2626
setup(
2727
name='py-dss-interface',
28-
version='0.0.0',
28+
version='0.0.1',
2929
license='MIT',
3030
description='opendsspy is a Windows Python package providing access to OpenDSS direct dll version of OpenDSS.',
3131
long_description='%s\n%s' % (
@@ -37,6 +37,7 @@ def read(*names, **kwargs):
3737
url='https://github.com/PauloRadatz/py_dss_interface',
3838
packages=find_packages('src'),
3939
package_dir={'': 'src'},
40+
package_data={'py-dss-interface': ['DDLL/64/OpenDSSDirect.dll']},
4041
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
4142
include_package_data=True,
4243
zip_safe=False,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/py_dss_interface/DSS.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: iso-8859-15 -*-
22

3+
import sys
34
import ctypes
45
from comtypes import automation
56
import os
@@ -13,13 +14,20 @@ def __init__(self, dll_folder=None):
1314

1415
if dll_folder == None:
1516
script_path = os.path.dirname(os.path.abspath(__file__))
16-
dll_folder = os.path.join(pathlib.Path(script_path).parent.parent, "DDLL")
17+
dll_folder = os.path.join(pathlib.Path(script_path), "DDLL")
1718

1819
self.opendss_started = False
1920

2021
if platform.architecture()[0] == "64bit":
21-
self.dssObj = ctypes.CDLL(os.path.join(dll_folder, "64", "OpenDSSDirect.dll"))
22-
self.opendss_started = True
22+
23+
try:
24+
os.chdir(os.path.join(dll_folder, "64"))
25+
self.dssObj = ctypes.WinDLL("OpenDSSDirect.dll")
26+
self.opendss_started = True
27+
except:
28+
os.chdir(os.path.join(dll_folder, "64"))
29+
self.dssObj = ctypes.WinDLL(os.path.join(dll_folder, "64", "OpenDSSDirect.dll"))
30+
self.opendss_started = True
2331
elif platform.architecture()[0] == "32bit":
2432
os.chdir(os.path.join(dll_folder, "32"))
2533
self.dssObj = ctypes.CDLL(os.path.join(dll_folder, "32", "OpenDSSDirect.dll"))
595 KB
Binary file not shown.
948 KB
Binary file not shown.
Binary file not shown.
595 KB
Binary file not shown.
203 KB
Binary file not shown.
10.8 MB
Binary file not shown.

tests/py_dss_interface/test_DSS.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import py_dss_interface
66

77
script_path = os.path.dirname(os.path.abspath(__file__))
8-
ddll_path = os.path.join(pathlib.Path(script_path).parent.parent, "DDLL")
8+
ddll_path = os.path.join(pathlib.Path(script_path), "DDLL")
99

1010
@pytest.fixture
1111
def DSS():

0 commit comments

Comments
 (0)