Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions catkit2/services/newport_xps_q8/newport_xps_q8.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import numpy as np
import traceback

library_path = os.environ.get('CATKIT_NEWPORT_LIB_PATH')
if not library_path:
raise RuntimeError("To use the Newport XPS-Q8, you need to set the CATKIT_NEWPORT_LIB_PATH environment variable.")
sys.path.append(library_path)

try:
library_path = os.environ.get('CATKIT_NEWPORT_LIB_PATH')
if library_path:
sys.path.append(library_path)
import XPS_Q8_drivers
except ImportError:
print("To use the Newport XPS-Q8, you need to set the CATKIT_NEWPORT_LIB_PATH environment variable.")
raise
except ModuleNotFoundError:
raise ModuleNotFoundError(f"Could not import XPS_Q8_drivers from CATKIT_NEWPORT_LIB_PATH={library_path!r}.")


class NewportXpsQ8(Service):
Expand Down
Loading