Skip to content

Commit

Permalink
update rsxml loading
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyMWhitehead committed Sep 9, 2024
1 parent 957e895 commit 362e00a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import os

RSXML_VERSION = '2.0.1'
from qgis.core import QgsMessageLog, Qgis

RSXML_VERSION = '2.0.6'

# This is how we import the rsxml module. We do this because we want to bundle the rsxml whl with this package
try:
import rsxml
print('rsxml imported from site-packages')
QgsMessageLog.logMessage('rsxml imported from system', 'Riverscapes Viewer', Qgis.Info)
except ImportError:
import sys
import os
this_dir = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(this_dir, '..', 'wheels', f'rsxml-{RSXML_VERSION}-py3-none-any.whl')
sys.path.append(path)
if not os.path.exists(path):
raise Exception('rsxml wheel not found at {}.'.format(path))
raise Exception(f'rsxml wheel not found at {path}.')
import rsxml
print('rsxml imported from wheels')
QgsMessageLog.logMessage(f'rsxml imported from wheel {path}', 'Riverscapes Viewer', Qgis.Info)

0 comments on commit 362e00a

Please sign in to comment.