-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packaging: add help importing qstack_qml in __init__
- Loading branch information
1 parent
f445532
commit 9754a2a
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# qstack.qml is in a different python package | ||
# but prefer "the local version of it" if we are in a development environment, and both sources are there. | ||
import os | ||
_qstack_qml_path = os.path.join(os.path.dirname(__file__), 'qstack-qml') | ||
if os.path.isfile(os.path.join(_qstack_qml_path, 'qstack_qml', '__init__.py')): | ||
import sys | ||
sys.path.insert(0,_qstack_qml_path) | ||
from qstack_qml import * | ||
sys.path.pop(0) | ||
del sys | ||
else: | ||
try: | ||
from qstack_qml import * | ||
except ImportError: | ||
pass | ||
del os, _qstack_qml_path |