Skip to content

Commit 0b43e98

Browse files
committed
niflib/pywrap
* fixed relative paths * added tests for static cast and dynamic cast (dynamic casting fails) * using BUILD_NIFLIB_DLL and USE_NIFLIB_DLL defines * directory can be used as python library ("import docsys") * extended search path of xml files, to cope with the above case
1 parent 2aa308d commit 0b43e98

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = ["nifxml"]

nifxml.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,14 @@ def find_first_ref(self, name):
13691369
# import elements into our code generating classes
13701370
#
13711371

1372-
doc = parse("nif.xml")
1372+
# import via "import nifxml" from .
1373+
if os.path.exists("nif.xml"):
1374+
doc = parse("nif.xml")
1375+
# import via "import docsys" from ..
1376+
elif os.path.exists("docsys/nif.xml"):
1377+
doc = parse("docsys/nif.xml")
1378+
else:
1379+
raise ImportError("nif.xml not found")
13731380

13741381
for element in doc.getElementsByTagName('version'):
13751382
x = Version(element)

0 commit comments

Comments
 (0)