python: improve support of spot-extra, and recent swig
I could not run "make check" in a copy of seminator 2.0 regenerated with swig 4.0, because of changes in the way Swig imports its shared libraries. * python/spot/__init__.py: If sys.path contains "/spot-extra" directory, add it to spot.__path__ as well. This helps situations where a plugin use libtool and the development tree has the shared libraries in .../spot-extra/.libs/
This commit is contained in:
parent
89a06772b8
commit
c9911962d4
1 changed files with 9 additions and 3 deletions
|
|
@ -38,11 +38,17 @@ if 'SPOT_UNINSTALLED' in os.environ:
|
||||||
# We may have third-party plugins that want to be loaded as "spot.xxx", but
|
# We may have third-party plugins that want to be loaded as "spot.xxx", but
|
||||||
# that are installed in a different $prefix. This sets things so that any
|
# that are installed in a different $prefix. This sets things so that any
|
||||||
# file that looks like spot-extra/xxx.py can be loaded with "import spot.xxx".
|
# file that looks like spot-extra/xxx.py can be loaded with "import spot.xxx".
|
||||||
|
# When libtool is used in a development build, it is likely that PYTHONPATH
|
||||||
|
# is already set up to contains something like .../spot-extra/.libs, so we
|
||||||
|
# want to copy those as well.
|
||||||
for path in sys.path:
|
for path in sys.path:
|
||||||
if path not in __path__:
|
if path not in __path__:
|
||||||
path += "/spot-extra"
|
if "/spot-extra" in path:
|
||||||
if os.path.isdir(path):
|
|
||||||
__path__.append(path)
|
__path__.append(path)
|
||||||
|
else:
|
||||||
|
path += "/spot-extra"
|
||||||
|
if os.path.isdir(path):
|
||||||
|
__path__.append(path)
|
||||||
|
|
||||||
|
|
||||||
from spot.impl import *
|
from spot.impl import *
|
||||||
|
|
@ -58,7 +64,7 @@ from spot.aux import \
|
||||||
ostream_to_svg as _ostream_to_svg
|
ostream_to_svg as _ostream_to_svg
|
||||||
|
|
||||||
|
|
||||||
# The parrameters used by default when show() is called on an automaton.
|
# The parameters used by default when show() is called on an automaton.
|
||||||
_show_default = None
|
_show_default = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue